a = set()
n = int(input())
for i in range(n):
    s = input().split()
    if(s[0]=="insert"):
        a.add(s[1])
    else:
        if(s[1] in a):
            print("yes")
        else:
            print("no") a = set() a set() set n = int(input()) n int(input()) int input() input for i in range(n):
    s = input().split()
    if(s[0]=="insert"):
        a.add(s[1])
    else:
        if(s[1] in a):
            print("yes")
        else:
            print("no") i range(n) range n s = input().split() s input().split() ().split () input split if(s[0]=="insert"):
        a.add(s[1])
    else:
        if(s[1] in a):
            print("yes")
        else:
            print("no") s[0]=="insert" s[0] s 0 "insert" a.add(s[1]) a.add a add s[1] s 1 if(s[1] in a):
            print("yes")
        else:
            print("no") s[1] in a s[1] s 1 a print("yes") print "yes" print("no") print "no" n = int(input()) int(input()) n s = input().split() input().split() s a = set() set() a
a = set()
n = int(input())
for i in range(n):
    s = input().split()
    if(s[0]=="insert"):
        a.add(s[1])
    else:
        if(s[1] in a):
            print("yes")
        else:
            print("no")