n = int(input())
D = set()
for _ in range(n):
    q, s = map(str, input().split())
    if q == 'insert':
        D.add(s)
    elif q == 'find':
        if s in D:
            print('yes')
        else:
            print('no') n = int(input()) n int(input()) int input() input D = set() D set() set for _ in range(n):
    q, s = map(str, input().split())
    if q == 'insert':
        D.add(s)
    elif q == 'find':
        if s in D:
            print('yes')
        else:
            print('no') _ range(n) range n q, s = map(str, input().split()) q map(str, input().split()) map str input().split() ().split () input split s if q == 'insert':
        D.add(s)
    elif q == 'find':
        if s in D:
            print('yes')
        else:
            print('no') q == 'insert' q 'insert' D.add(s) D.add D add s elif q == 'find':
        if s in D:
            print('yes')
        else:
            print('no') q == 'find' q 'find' if s in D:
            print('yes')
        else:
            print('no') s in D s D print('yes') print 'yes' print('no') print 'no' D = set() set() D s = map(str, input().split()) map(str, input().split()) s q, s = map(str, input().split()) map(str, input().split()) q n = int(input()) int(input()) n
n = int(input())
D = set()
for _ in range(n):
    q, s = map(str, input().split())
    if q == 'insert':
        D.add(s)
    elif q == 'find':
        if s in D:
            print('yes')
        else:
            print('no')
