dic = {}

n = int(input())

for i in range(n):
    op, key = input().split()
    h_key = hash(key) 
    if op == "insert":
        dic[h_key] = 1
    else:
        if h_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()
    h_key = hash(key) 
    if op == "insert":
        dic[h_key] = 1
    else:
        if h_key in dic:
            print("yes")
        else:
            print("no") i range(n) range n op, key = input().split() op input().split() ().split () input split key h_key = hash(key) h_key hash(key) hash key if op == "insert":
        dic[h_key] = 1
    else:
        if h_key in dic:
            print("yes")
        else:
            print("no") op == "insert" op "insert" dic[h_key] = 1 dic[h_key] dic h_key 1 if h_key in dic:
            print("yes")
        else:
            print("no") h_key in dic h_key dic print("yes") print "yes" print("no") print "no" dic = {} {} dic op, key = input().split() input().split() op key = input().split() input().split() key n = int(input()) int(input()) n h_key = hash(key) hash(key) h_key
dic = {}

n = int(input())

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