n = int(input())
data = {}
for i in range(n):
    a,b = map(str,input().split())
    if a == "insert":
        data[b] = 1
    else:
        if b in data:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input data = {} data {} for i in range(n):
    a,b = map(str,input().split())
    if a == "insert":
        data[b] = 1
    else:
        if b in data:
            print("yes")
        else:
            print("no") i range(n) range n a,b = map(str,input().split()) a map(str,input().split()) map str input().split() ().split () input split b if a == "insert":
        data[b] = 1
    else:
        if b in data:
            print("yes")
        else:
            print("no") a == "insert" a "insert" data[b] = 1 data[b] data b 1 if b in data:
            print("yes")
        else:
            print("no") b in data b data print("yes") print "yes" print("no") print "no" data = {} {} data b = map(str,input().split()) map(str,input().split()) b n = int(input()) int(input()) n a,b = map(str,input().split()) map(str,input().split()) a
n = int(input())
data = {}
for i in range(n):
    a,b = map(str,input().split())
    if a == "insert":
        data[b] = 1
    else:
        if b in data:
            print("yes")
        else:
            print("no")
