n = int(input())
order = [''] * n
st = [''] * n
for i in range(n):
    order[i], st[i] = map(str, input().split())

dic = {}
for i in range(n):
    if order[i] == 'insert':
        dic.setdefault(st[i], 0)
    else:
        if st[i] in dic:
            print('yes')
        else:
            print('no') n = int(input()) n int(input()) int input() input order = [''] * n order [''] * n [''] '' n st = [''] * n st [''] * n [''] '' n for i in range(n):
    order[i], st[i] = map(str, input().split()) i range(n) range n order[i], st[i] = map(str, input().split()) order[i] order i map(str, input().split()) map str input().split() ().split () input split st[i] st i dic = {} dic {} for i in range(n):
    if order[i] == 'insert':
        dic.setdefault(st[i], 0)
    else:
        if st[i] in dic:
            print('yes')
        else:
            print('no') i range(n) range n if order[i] == 'insert':
        dic.setdefault(st[i], 0)
    else:
        if st[i] in dic:
            print('yes')
        else:
            print('no') order[i] == 'insert' order[i] order i 'insert' dic.setdefault(st[i], 0) dic.setdefault dic setdefault st[i] st i 0 if st[i] in dic:
            print('yes')
        else:
            print('no') st[i] in dic st[i] st i dic print('yes') print 'yes' print('no') print 'no' st = [''] * n [''] * n st n = int(input()) int(input()) n order = [''] * n [''] * n order dic = {} {} dic
n = int(input())
order = [''] * n
st = [''] * n
for i in range(n):
    order[i], st[i] = map(str, input().split())

dic = {}
for i in range(n):
    if order[i] == 'insert':
        dic.setdefault(st[i], 0)
    else:
        if st[i] in dic:
            print('yes')
        else:
            print('no')
