import sys

dict = {}
n = int(input())
l = []
line = map(lambda x:x.split(), sys.stdin.readlines())
s = ""
for (c,arg) in line:
    if c == "insert":
        dict[arg] = 0
    elif c == "find":
        if arg in dict:
            s += "yes\n"
        else:
            s += "no\n"
print(s,end="") import sys sys dict = {} dict {} n = int(input()) n int(input()) int input() input l = [] l [] 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 s = "" s "" for (c,arg) in line:
    if c == "insert":
        dict[arg] = 0
    elif c == "find":
        if arg in dict:
            s += "yes\n"
        else:
            s += "no\n" (c,arg) c arg line if c == "insert":
        dict[arg] = 0
    elif c == "find":
        if arg in dict:
            s += "yes\n"
        else:
            s += "no\n" c == "insert" c "insert" dict[arg] = 0 dict[arg] dict arg 0 elif c == "find":
        if arg in dict:
            s += "yes\n"
        else:
            s += "no\n" c == "find" c "find" if arg in dict:
            s += "yes\n"
        else:
            s += "no\n" arg in dict arg dict s += "yes\n" s "yes\n" s += "no\n" s "no\n" print(s,end="") print s end="" end "" l = [] [] l line = map(lambda x:x.split(), sys.stdin.readlines()) map(lambda x:x.split(), sys.stdin.readlines()) line n = int(input()) int(input()) n s += "no\n" "no\n" s s = "" "" s dict = {} {} dict s += "yes\n" "yes\n" s
import sys

dict = {}
n = int(input())
l = []
line = map(lambda x:x.split(), sys.stdin.readlines())
s = ""
for (c,arg) in line:
    if c == "insert":
        dict[arg] = 0
    elif c == "find":
        if arg in dict:
            s += "yes\n"
        else:
            s += "no\n"
print(s,end="")