n = int(input())

dic = {}

for _ in range(n):
    command = input().split(" ")
    if command[0] == "insert":
        dic[command[1]] = 1
    else:
        if command[1] in dic:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input dic = {} dic {} for _ in range(n):
    command = input().split(" ")
    if command[0] == "insert":
        dic[command[1]] = 1
    else:
        if command[1] in dic:
            print("yes")
        else:
            print("no") _ range(n) range n command = input().split(" ") command input().split(" ") ().split () input split " " if command[0] == "insert":
        dic[command[1]] = 1
    else:
        if command[1] in dic:
            print("yes")
        else:
            print("no") command[0] == "insert" command[0] command 0 "insert" dic[command[1]] = 1 dic[command[1]] dic command[1] command 1 1 if command[1] in dic:
            print("yes")
        else:
            print("no") command[1] in dic command[1] command 1 dic print("yes") print "yes" print("no") print "no" dic = {} {} dic command = input().split(" ") input().split(" ") command n = int(input()) int(input()) n
n = int(input())

dic = {}

for _ in range(n):
    command = input().split(" ")
    if command[0] == "insert":
        dic[command[1]] = 1
    else:
        if command[1] in dic:
            print("yes")
        else:
            print("no")