import sys
n = int(input())
command = sys.stdin.readlines()
Q = {}
for i in range(n):
    a,b = command[i].split()
    if a == "insert":
        Q[b] = 0
    else:
        if b in Q.keys():
            print("yes")
        else:
            print("no") import sys sys n = int(input()) n int(input()) int input() input command = sys.stdin.readlines() command sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines Q = {} Q {} for i in range(n):
    a,b = command[i].split()
    if a == "insert":
        Q[b] = 0
    else:
        if b in Q.keys():
            print("yes")
        else:
            print("no") i range(n) range n a,b = command[i].split() a command[i].split() [i].split [i] command i split b if a == "insert":
        Q[b] = 0
    else:
        if b in Q.keys():
            print("yes")
        else:
            print("no") a == "insert" a "insert" Q[b] = 0 Q[b] Q b 0 if b in Q.keys():
            print("yes")
        else:
            print("no") b in Q.keys() b Q.keys() Q.keys Q keys print("yes") print "yes" print("no") print "no" a,b = command[i].split() command[i].split() a n = int(input()) int(input()) n command = sys.stdin.readlines() sys.stdin.readlines() command b = command[i].split() command[i].split() b Q = {} {} Q
import sys
n = int(input())
command = sys.stdin.readlines()
Q = {}
for i in range(n):
    a,b = command[i].split()
    if a == "insert":
        Q[b] = 0
    else:
        if b in Q.keys():
            print("yes")
        else:
            print("no")