N = int(input())
d = {}
for i in [None]*N:
    a, b = input().split()
    if a == "insert":
        d[b] = 1
    else:
        print("yes" if b in d else "no") N = int(input()) N int(input()) int input() input d = {} d {} for i in [None]*N:
    a, b = input().split()
    if a == "insert":
        d[b] = 1
    else:
        print("yes" if b in d else "no") i [None]*N [None] None N a, b = input().split() a input().split() ().split () input split b if a == "insert":
        d[b] = 1
    else:
        print("yes" if b in d else "no") a == "insert" a "insert" d[b] = 1 d[b] d b 1 print("yes" if b in d else "no") print "yes" if b in d else "no" b in d b d "yes" "no" N = int(input()) int(input()) N a, b = input().split() input().split() a d = {} {} d b = input().split() input().split() b
N = int(input())
d = {}
for i in [None]*N:
    a, b = input().split()
    if a == "insert":
        d[b] = 1
    else:
        print("yes" if b in d else "no")