mp = {}
for _ in range(int(input())):
    op, x = input().split()
    if op == "insert":
        mp[x] = True
    else:
        print(['no', 'yes'][x in mp]) mp = {} mp {} for _ in range(int(input())):
    op, x = input().split()
    if op == "insert":
        mp[x] = True
    else:
        print(['no', 'yes'][x in mp]) _ range(int(input())) range int(input()) int input() input op, x = input().split() op input().split() ().split () input split x if op == "insert":
        mp[x] = True
    else:
        print(['no', 'yes'][x in mp]) op == "insert" op "insert" mp[x] = True mp[x] mp x True print(['no', 'yes'][x in mp]) print ['no', 'yes'][x in mp] ['no', 'yes'] 'no' 'yes' x in mp x mp mp = {} {} mp x = input().split() input().split() x op, x = input().split() input().split() op
mp = {}
for _ in range(int(input())):
    op, x = input().split()
    if op == "insert":
        mp[x] = True
    else:
        print(['no', 'yes'][x in mp])
