n = int(input())
d = set()
for i in range(n):
    cmd, val = input().split()
    if cmd == 'insert':
        d.add(val)
    else:
        print('yes'*(val in d)or'no') n = int(input()) n int(input()) int input() input d = set() d set() set for i in range(n):
    cmd, val = input().split()
    if cmd == 'insert':
        d.add(val)
    else:
        print('yes'*(val in d)or'no') i range(n) range n cmd, val = input().split() cmd input().split() ().split () input split val if cmd == 'insert':
        d.add(val)
    else:
        print('yes'*(val in d)or'no') cmd == 'insert' cmd 'insert' d.add(val) d.add d add val print('yes'*(val in d)or'no') print 'yes'*(val in d)or'no' 'yes'*(val in d) 'yes' val in d val d 'no' d = set() set() d n = int(input()) int(input()) n val = input().split() input().split() val cmd, val = input().split() input().split() cmd
n = int(input())
d = set()
for i in range(n):
    cmd, val = input().split()
    if cmd == 'insert':
        d.add(val)
    else:
        print('yes'*(val in d)or'no')