n=int(input())
answer=[]
d={}
for i in range(n):
    cmd,word=input().split()
    if cmd=="insert":
        d[word]=True
    
    else:
        if word in d:
            print("yes")

        else:
            print("no")

 n=int(input()) n int(input()) int input() input answer=[] answer [] d={} d {} for i in range(n):
    cmd,word=input().split()
    if cmd=="insert":
        d[word]=True
    
    else:
        if word in d:
            print("yes")

        else:
            print("no") i range(n) range n cmd,word=input().split() cmd input().split() ().split () input split word if cmd=="insert":
        d[word]=True
    
    else:
        if word in d:
            print("yes")

        else:
            print("no") cmd=="insert" cmd "insert" d[word]=True d[word] d word True if word in d:
            print("yes")

        else:
            print("no") word in d word d print("yes") print "yes" print("no") print "no" n=int(input()) int(input()) n answer=[] [] answer cmd,word=input().split() input().split() cmd d={} {} d word=input().split() input().split() word
n=int(input())
answer=[]
d={}
for i in range(n):
    cmd,word=input().split()
    if cmd=="insert":
        d[word]=True
    
    else:
        if word in d:
            print("yes")

        else:
            print("no")


