import sys
readline = sys.stdin.readline
SET = set()
for _ in range(int(readline())):
    c, s = readline().split()
    if c == "insert":
        SET.add(s)
    elif c == "find":
        print("yes" if s in SET else "no")
 import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline SET = set() SET set() set for _ in range(int(readline())):
    c, s = readline().split()
    if c == "insert":
        SET.add(s)
    elif c == "find":
        print("yes" if s in SET else "no") _ range(int(readline())) range int(readline()) int readline() readline c, s = readline().split() c readline().split() ().split () readline split s if c == "insert":
        SET.add(s)
    elif c == "find":
        print("yes" if s in SET else "no") c == "insert" c "insert" SET.add(s) SET.add SET add s elif c == "find":
        print("yes" if s in SET else "no") c == "find" c "find" print("yes" if s in SET else "no") print "yes" if s in SET else "no" s in SET s SET "yes" "no" SET = set() set() SET c, s = readline().split() readline().split() c readline = sys.stdin.readline sys.stdin.readline readline s = readline().split() readline().split() s
import sys
readline = sys.stdin.readline
SET = set()
for _ in range(int(readline())):
    c, s = readline().split()
    if c == "insert":
        SET.add(s)
    elif c == "find":
        print("yes" if s in SET else "no")

