def insert(cnt, data):
    T[str(data)] = cnt


cnt = 0
T = {}
n = int(input())
for i in range(n):
    Order, data_S = input().split()
    if Order[0] =="i":
        insert(cnt, data_S)
        cnt +=1

    else:
        if str(data_S) in T:
            print("yes")
        else:
            print("no") def insert(cnt, data):
    T[str(data)] = cnt insert T[str(data)] = cnt T[str(data)] T str(data) str data cnt cnt cnt data data cnt = 0 cnt 0 T = {} T {} n = int(input()) n int(input()) int input() input for i in range(n):
    Order, data_S = input().split()
    if Order[0] =="i":
        insert(cnt, data_S)
        cnt +=1

    else:
        if str(data_S) in T:
            print("yes")
        else:
            print("no") i range(n) range n Order, data_S = input().split() Order input().split() ().split () input split data_S if Order[0] =="i":
        insert(cnt, data_S)
        cnt +=1

    else:
        if str(data_S) in T:
            print("yes")
        else:
            print("no") Order[0] =="i" Order[0] Order 0 "i" insert(cnt, data_S) insert cnt data_S cnt +=1 cnt 1 if str(data_S) in T:
            print("yes")
        else:
            print("no") str(data_S) in T str(data_S) str data_S T print("yes") print "yes" print("no") print "no" data_S = input().split() input().split() data_S def insert(cnt, data):
    T[str(data)] = cnt def insert(cnt, data):
    T[str(data)] = cnt insert cnt = 0 0 cnt T = {} {} T n = int(input()) int(input()) n Order, data_S = input().split() input().split() Order cnt +=1 1 cnt
def insert(cnt, data):
    T[str(data)] = cnt


cnt = 0
T = {}
n = int(input())
for i in range(n):
    Order, data_S = input().split()
    if Order[0] =="i":
        insert(cnt, data_S)
        cnt +=1

    else:
        if str(data_S) in T:
            print("yes")
        else:
            print("no")
