n = int(input())
d = {}
for i in range(n):
    c, s = input().split()
    if c == "insert":
        d[s] = 0
    else:
        if s in d:
            print("yes")
        else:
            print("no")
         n = int(input()) n int(input()) int input() input d = {} d {} for i in range(n):
    c, s = input().split()
    if c == "insert":
        d[s] = 0
    else:
        if s in d:
            print("yes")
        else:
            print("no")
         i range(n) range n c, s = input().split() c input().split() ().split () input split s if c == "insert":
        d[s] = 0
    else:
        if s in d:
            print("yes")
        else:
            print("no")
         c == "insert" c "insert" d[s] = 0 d[s] d s 0 if s in d:
            print("yes")
        else:
            print("no")
         s in d s d print("yes") print "yes" print("no") print "no" d = {} {} d s = input().split() input().split() s c, s = input().split() input().split() c n = int(input()) int(input()) n
n = int(input())
d = {}
for i in range(n):
    c, s = input().split()
    if c == "insert":
        d[s] = 0
    else:
        if s in d:
            print("yes")
        else:
            print("no")
        
