dic = {}
for s in range(int(input())):
    i = input().split()
    if i[0] == "insert":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no") dic = {} dic {} for s in range(int(input())):
    i = input().split()
    if i[0] == "insert":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no") s range(int(input())) range int(input()) int input() input i = input().split() i input().split() ().split () input split if i[0] == "insert":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no") i[0] == "insert" i[0] i 0 "insert" dic[i[1]] = None dic[i[1]] dic i[1] i 1 None print("yes" if i[1] in dic else "no") print "yes" if i[1] in dic else "no" i[1] in dic i[1] i 1 dic "yes" "no" dic = {} {} dic i = input().split() input().split() i
dic = {}
for s in range(int(input())):
    i = input().split()
    if i[0] == "insert":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no")