d = set()
n = int(input())
for i in range(n):
    raw=input().split()
    if raw[0] == 'insert':
        d.add(raw[1])
    else:
        if raw[1] in d:
            print('yes')
        else:
            print('no')
 d = set() d set() set n = int(input()) n int(input()) int input() input for i in range(n):
    raw=input().split()
    if raw[0] == 'insert':
        d.add(raw[1])
    else:
        if raw[1] in d:
            print('yes')
        else:
            print('no') i range(n) range n raw=input().split() raw input().split() ().split () input split if raw[0] == 'insert':
        d.add(raw[1])
    else:
        if raw[1] in d:
            print('yes')
        else:
            print('no') raw[0] == 'insert' raw[0] raw 0 'insert' d.add(raw[1]) d.add d add raw[1] raw 1 if raw[1] in d:
            print('yes')
        else:
            print('no') raw[1] in d raw[1] raw 1 d print('yes') print 'yes' print('no') print 'no' d = set() set() d raw=input().split() input().split() raw n = int(input()) int(input()) n
d = set()
n = int(input())
for i in range(n):
    raw=input().split()
    if raw[0] == 'insert':
        d.add(raw[1])
    else:
        if raw[1] in d:
            print('yes')
        else:
            print('no')

