n = int(input())
dic = set()
for i in range(n):
    Cmd, Key = input().split(" ")
    if Cmd == "insert":
	    dic.add(Key)
    else:
        if Key in dic:
	        print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input dic = set() dic set() set for i in range(n):
    Cmd, Key = input().split(" ")
    if Cmd == "insert":
	    dic.add(Key)
    else:
        if Key in dic:
	        print("yes")
        else:
            print("no") i range(n) range n Cmd, Key = input().split(" ") Cmd input().split(" ") ().split () input split " " Key if Cmd == "insert":
	    dic.add(Key)
    else:
        if Key in dic:
	        print("yes")
        else:
            print("no") Cmd == "insert" Cmd "insert" dic.add(Key) dic.add dic add Key if Key in dic:
	        print("yes")
        else:
            print("no") Key in dic Key dic print("yes") print "yes" print("no") print "no" n = int(input()) int(input()) n Cmd, Key = input().split(" ") input().split(" ") Cmd Key = input().split(" ") input().split(" ") Key dic = set() set() dic
n = int(input())
dic = set()
for i in range(n):
    Cmd, Key = input().split(" ")
    if Cmd == "insert":
	    dic.add(Key)
    else:
        if Key in dic:
	        print("yes")
        else:
            print("no")