dic = {}
n = int(input())
for i in range(n):
    op, key = input().split()
    if op == "insert":
        dic[key] = 1
    else:
        if key in dic:
            print("yes")
        else:
            print("no") dic = {} dic {} n = int(input()) n int(input()) int input() input for i in range(n):
    op, key = input().split()
    if op == "insert":
        dic[key] = 1
    else:
        if key in dic:
            print("yes")
        else:
            print("no") i range(n) range n op, key = input().split() op input().split() ().split () input split key if op == "insert":
        dic[key] = 1
    else:
        if key in dic:
            print("yes")
        else:
            print("no") op == "insert" op "insert" dic[key] = 1 dic[key] dic key 1 if key in dic:
            print("yes")
        else:
            print("no") key in dic key dic print("yes") print "yes" print("no") print "no" op, key = input().split() input().split() op key = input().split() input().split() key dic = {} {} dic n = int(input()) int(input()) n
dic = {}
n = int(input())
for i in range(n):
    op, key = input().split()
    if op == "insert":
        dic[key] = 1
    else:
        if key in dic:
            print("yes")
        else:
            print("no")