n = int(input())
a = {}
for i in range(n):
    x,m = input().split()
    if x[0] =='i':a[m] = 0
    else:
        if m in a:
            print('yes')
        else:
            print('no')
    
    
     n = int(input()) n int(input()) int input() input a = {} a {} for i in range(n):
    x,m = input().split()
    if x[0] =='i':a[m] = 0
    else:
        if m in a:
            print('yes')
        else:
            print('no')
    
    
     i range(n) range n x,m = input().split() x input().split() ().split () input split m if x[0] =='i':a[m] = 0
    else:
        if m in a:
            print('yes')
        else:
            print('no')
    
    
     x[0] =='i' x[0] x 0 'i' if m in a:
            print('yes')
        else:
            print('no')
    
    
     m in a m a print('yes') print 'yes' print('no') print 'no' a = {} {} a m = input().split() input().split() m n = int(input()) int(input()) n x,m = input().split() input().split() x
n = int(input())
a = {}
for i in range(n):
    x,m = input().split()
    if x[0] =='i':a[m] = 0
    else:
        if m in a:
            print('yes')
        else:
            print('no')
    
    
    
