n = int(input())
index = set()

for _ in range(n):
    command, string = input().split()
    if command == "insert":
        index.add(string)
    else:
        if string in index:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input index = set() index set() set for _ in range(n):
    command, string = input().split()
    if command == "insert":
        index.add(string)
    else:
        if string in index:
            print("yes")
        else:
            print("no") _ range(n) range n command, string = input().split() command input().split() ().split () input split string if command == "insert":
        index.add(string)
    else:
        if string in index:
            print("yes")
        else:
            print("no") command == "insert" command "insert" index.add(string) index.add index add string if string in index:
            print("yes")
        else:
            print("no") string in index string index print("yes") print "yes" print("no") print "no" index = set() set() index string = input().split() input().split() string command, string = input().split() input().split() command n = int(input()) int(input()) n
n = int(input())
index = set()

for _ in range(n):
    command, string = input().split()
    if command == "insert":
        index.add(string)
    else:
        if string in index:
            print("yes")
        else:
            print("no")
