n = int(input())
mydict = {}
answer_list = []

for i in range(n) :
    query, wd = input().split()
    
    if query == "insert" :
        mydict[wd] = 1
    else :
        if wd in mydict.keys() : answer_list.append("yes")
        else : answer_list.append("no")
        
for i in answer_list :
    print(i) n = int(input()) n int(input()) int input() input mydict = {} mydict {} answer_list = [] answer_list [] for i in range(n) :
    query, wd = input().split()
    
    if query == "insert" :
        mydict[wd] = 1
    else :
        if wd in mydict.keys() : answer_list.append("yes")
        else : answer_list.append("no")
         i range(n) range n query, wd = input().split() query input().split() ().split () input split wd if query == "insert" :
        mydict[wd] = 1
    else :
        if wd in mydict.keys() : answer_list.append("yes")
        else : answer_list.append("no")
         query == "insert" query "insert" mydict[wd] = 1 mydict[wd] mydict wd 1 if wd in mydict.keys() : answer_list.append("yes")
        else : answer_list.append("no")
         wd in mydict.keys() wd mydict.keys() mydict.keys mydict keys for i in answer_list :
    print(i) i answer_list print(i) print i answer_list = [] [] answer_list wd = input().split() input().split() wd mydict = {} {} mydict n = int(input()) int(input()) n query, wd = input().split() input().split() query
n = int(input())
mydict = {}
answer_list = []

for i in range(n) :
    query, wd = input().split()
    
    if query == "insert" :
        mydict[wd] = 1
    else :
        if wd in mydict.keys() : answer_list.append("yes")
        else : answer_list.append("no")
        
for i in answer_list :
    print(i)
