# coding: utf-8
# Here your code !
N=int(input())
dict={}
for i in range(N):
    a,b=input().split()
    if a=="insert":
        dict[b]=i
    else:
        if b in dict:
            print("yes")
        else:
            print("no") N=int(input()) N int(input()) int input() input dict={} dict {} for i in range(N):
    a,b=input().split()
    if a=="insert":
        dict[b]=i
    else:
        if b in dict:
            print("yes")
        else:
            print("no") i range(N) range N a,b=input().split() a input().split() ().split () input split b if a=="insert":
        dict[b]=i
    else:
        if b in dict:
            print("yes")
        else:
            print("no") a=="insert" a "insert" dict[b]=i dict[b] dict b i if b in dict:
            print("yes")
        else:
            print("no") b in dict b dict print("yes") print "yes" print("no") print "no" b=input().split() input().split() b N=int(input()) int(input()) N dict={} {} dict a,b=input().split() input().split() a
# coding: utf-8
# Here your code !
N=int(input())
dict={}
for i in range(N):
    a,b=input().split()
    if a=="insert":
        dict[b]=i
    else:
        if b in dict:
            print("yes")
        else:
            print("no")