s = set()
for _ in range(int(input())):
    c = input().split()
    if c[0] == 'insert':
        s.add(c[1])
    else:
        print('yes' if c[1] in s else 'no') s = set() s set() set for _ in range(int(input())):
    c = input().split()
    if c[0] == 'insert':
        s.add(c[1])
    else:
        print('yes' if c[1] in s else 'no') _ range(int(input())) range int(input()) int input() input c = input().split() c input().split() ().split () input split if c[0] == 'insert':
        s.add(c[1])
    else:
        print('yes' if c[1] in s else 'no') c[0] == 'insert' c[0] c 0 'insert' s.add(c[1]) s.add s add c[1] c 1 print('yes' if c[1] in s else 'no') print 'yes' if c[1] in s else 'no' c[1] in s c[1] c 1 s 'yes' 'no' s = set() set() s c = input().split() input().split() c
s = set()
for _ in range(int(input())):
    c = input().split()
    if c[0] == 'insert':
        s.add(c[1])
    else:
        print('yes' if c[1] in s else 'no')