N = int(input())
dictionary = dict()
for i in range(N):
    command, string = input().split()
    if command == "insert":
        dictionary[string] = True
    elif dictionary.get(string) == None:
        print("no")
    else:
        print("yes") N = int(input()) N int(input()) int input() input dictionary = dict() dictionary dict() dict for i in range(N):
    command, string = input().split()
    if command == "insert":
        dictionary[string] = True
    elif dictionary.get(string) == None:
        print("no")
    else:
        print("yes") i range(N) range N command, string = input().split() command input().split() ().split () input split string if command == "insert":
        dictionary[string] = True
    elif dictionary.get(string) == None:
        print("no")
    else:
        print("yes") command == "insert" command "insert" dictionary[string] = True dictionary[string] dictionary string True elif dictionary.get(string) == None:
        print("no")
     dictionary.get(string) == None dictionary.get(string) dictionary.get dictionary get string None print("no") print "no" print("yes") print "yes" command, string = input().split() input().split() command dictionary = dict() dict() dictionary N = int(input()) int(input()) N string = input().split() input().split() string
N = int(input())
dictionary = dict()
for i in range(N):
    command, string = input().split()
    if command == "insert":
        dictionary[string] = True
    elif dictionary.get(string) == None:
        print("no")
    else:
        print("yes")