import sys
input()
dic = {}
line = map(lambda x:x.split(), sys.stdin.readlines())
for i in line:
    if i[0] == "insert":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no") import sys sys input() input dic = {} dic {} line = map(lambda x:x.split(), sys.stdin.readlines()) line map(lambda x:x.split(), sys.stdin.readlines()) map lambda x:x.split() x.split() x.split x split x sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for i in line:
    if i[0] == "insert":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no") i line 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 line = map(lambda x:x.split(), sys.stdin.readlines()) map(lambda x:x.split(), sys.stdin.readlines()) line
import sys
input()
dic = {}
line = map(lambda x:x.split(), sys.stdin.readlines())
for i in line:
    if i[0] == "insert":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no")