n = int(input())
d = set()
for _ in range(n):
    c, s = input().split()
    if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no') n = int(input()) n int(input()) int input() input d = set() d set() set for _ in range(n):
    c, s = input().split()
    if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no') _ range(n) range n c, s = input().split() c input().split() ().split () input split s if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no') c == 'insert' c 'insert' d.add(s) d.add d add s print('yes' if s in d else 'no') print 'yes' if s in d else 'no' s in d s d 'yes' 'no' s = input().split() input().split() s c, s = input().split() input().split() c d = set() set() d n = int(input()) int(input()) n
n = int(input())
d = set()
for _ in range(n):
    c, s = input().split()
    if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no')
