n = int(input())
s = {2}
s.remove(2)
for i in range(n):
    order = list(map(str, input().split()))
    if (order[0][0] == 'i'):
        s.add(order[1])
    else:
        if order[1] in s:
            print('yes')
        else:
            print('no')
         n = int(input()) n int(input()) int input() input s = {2} s {2} s.remove(2) s.remove s remove 2 for i in range(n):
    order = list(map(str, input().split()))
    if (order[0][0] == 'i'):
        s.add(order[1])
    else:
        if order[1] in s:
            print('yes')
        else:
            print('no')
         i range(n) range n order = list(map(str, input().split())) order list(map(str, input().split())) list map(str, input().split()) map str input().split() ().split () input split if (order[0][0] == 'i'):
        s.add(order[1])
    else:
        if order[1] in s:
            print('yes')
        else:
            print('no')
         order[0][0] == 'i' order[0][0] [0] order 0 0 'i' s.add(order[1]) s.add s add order[1] order 1 if order[1] in s:
            print('yes')
        else:
            print('no')
         order[1] in s order[1] order 1 s print('yes') print 'yes' print('no') print 'no' s = {2} {2} s n = int(input()) int(input()) n order = list(map(str, input().split())) list(map(str, input().split())) order
n = int(input())
s = {2}
s.remove(2)
for i in range(n):
    order = list(map(str, input().split()))
    if (order[0][0] == 'i'):
        s.add(order[1])
    else:
        if order[1] in s:
            print('yes')
        else:
            print('no')
        
