N=int(input())
dic={}
for _ in range(N):
    c,s=input().split()
    if c=="insert":
        dic[s]=True
    else:
        print("yes" if s in dic else "no") N=int(input()) N int(input()) int input() input dic={} dic {} for _ in range(N):
    c,s=input().split()
    if c=="insert":
        dic[s]=True
    else:
        print("yes" if s in dic else "no") _ range(N) range N c,s=input().split() c input().split() ().split () input split s if c=="insert":
        dic[s]=True
    else:
        print("yes" if s in dic else "no") c=="insert" c "insert" dic[s]=True dic[s] dic s True print("yes" if s in dic else "no") print "yes" if s in dic else "no" s in dic s dic "yes" "no" dic={} {} dic c,s=input().split() input().split() c s=input().split() input().split() s N=int(input()) int(input()) N
N=int(input())
dic={}
for _ in range(N):
    c,s=input().split()
    if c=="insert":
        dic[s]=True
    else:
        print("yes" if s in dic else "no")
