Your task is to write a program of a simple _dictionary_ which implements the following instructions:    * **insert _str_** : insert a string _str_ in to the dictionary   * **find _str_** : if the distionary contains _str_ , then print 'yes', otherwise print 'no'
dic = {}
n = int(input())
for i in range(n):
    op, key = input().split()
    print(op, 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")