n = int(input())
D = set([])
for i in range(n):
    A,X = input().split()
    if A[0] == "i":
        D.add(X)
    else:
        if X in D:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input D = set([]) D set([]) set [] for i in range(n):
    A,X = input().split()
    if A[0] == "i":
        D.add(X)
    else:
        if X in D:
            print("yes")
        else:
            print("no") i range(n) range n A,X = input().split() A input().split() ().split () input split X if A[0] == "i":
        D.add(X)
    else:
        if X in D:
            print("yes")
        else:
            print("no") A[0] == "i" A[0] A 0 "i" D.add(X) D.add D add X if X in D:
            print("yes")
        else:
            print("no") X in D X D print("yes") print "yes" print("no") print "no" D = set([]) set([]) D A,X = input().split() input().split() A n = int(input()) int(input()) n X = input().split() input().split() X
n = int(input())
D = set([])
for i in range(n):
    A,X = input().split()
    if A[0] == "i":
        D.add(X)
    else:
        if X in D:
            print("yes")
        else:
            print("no")
