dic=dict()
n = int(input())
for i in range(n):
    a = input()
    t=a.split()
    if t[0] == "insert":
        dic[t[1]] = True
    else:
        if t[1] in dic:
            print("yes")
        else:
            print("no")
3e85790b4815b09a9020c6b09b135ce7a621ff64
<mask token>

<mask token>
for i in range(n):
    a = input()
    t = a.split()
    if t[0] == 'insert':
        dic[t[1]] = True
    elif t[1] in dic:
        print('yes')
    else:
        print('no')

dic = dict()
n = int(input())
for i in range(n):
    a = input()
    t = a.split()
    if t[0] == 'insert':
        dic[t[1]] = True
    elif t[1] in dic:
        print('yes')
    else:
        print('no')

dic=dict()
n = int(input())
for i in range(n):
    a = input()
    t=a.split()
    if t[0] == "insert":
        dic[t[1]] = True
    else:
        if t[1] in dic:
            print("yes")
        else:
            print("no")