n=input()

d=set()
for x in xrange(n):
    cmd, st = map(str, raw_input().split())
    
    if cmd == "insert":
        d.add(st)
    elif cmd == "find":
        print 'yes' if st in d else 'no' n=input() n input() input d=set() d set() set for x in xrange(n):
    cmd, st = map(str, raw_input().split())
    
    if cmd == "insert":
        d.add(st)
    elif cmd == "find":
        print 'yes' if st in d else 'no' x xrange(n) xrange n cmd, st = map(str, raw_input().split()) cmd map(str, raw_input().split()) map str raw_input().split() ().split () raw_input split st if cmd == "insert":
        d.add(st)
    elif cmd == "find":
        print 'yes' if st in d else 'no' cmd == "insert" cmd "insert" d.add(st) d.add d add st elif cmd == "find":
        print 'yes' if st in d else 'no' cmd == "find" cmd "find" print 'yes' if st in d else 'no' st in d st d 'yes' 'no' d=set() set() d cmd, st = map(str, raw_input().split()) map(str, raw_input().split()) cmd st = map(str, raw_input().split()) map(str, raw_input().split()) st n=input() input() n
n=input()

d=set()
for x in xrange(n):
    cmd, st = map(str, raw_input().split())
    
    if cmd == "insert":
        d.add(st)
    elif cmd == "find":
        print 'yes' if st in d else 'no'