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