n = int(input())
  
s = set()
for i in range(n):
    c, m = input().split()
    if c[0] == 'i':
        s.add(m)
    elif c[0] == 'f':
        if m in s:
            print('yes')
        else:
            print('no') n = int(input()) n int(input()) int input() input s = set() s set() set for i in range(n):
    c, m = input().split()
    if c[0] == 'i':
        s.add(m)
    elif c[0] == 'f':
        if m in s:
            print('yes')
        else:
            print('no') i range(n) range n c, m = input().split() c input().split() ().split () input split m if c[0] == 'i':
        s.add(m)
    elif c[0] == 'f':
        if m in s:
            print('yes')
        else:
            print('no') c[0] == 'i' c[0] c 0 'i' s.add(m) s.add s add m elif c[0] == 'f':
        if m in s:
            print('yes')
        else:
            print('no') c[0] == 'f' c[0] c 0 'f' if m in s:
            print('yes')
        else:
            print('no') m in s m s print('yes') print 'yes' print('no') print 'no' c, m = input().split() input().split() c s = set() set() s n = int(input()) int(input()) n m = input().split() input().split() m
n = int(input())
  
s = set()
for i in range(n):
    c, m = input().split()
    if c[0] == 'i':
        s.add(m)
    elif c[0] == 'f':
        if m in s:
            print('yes')
        else:
            print('no')