N = int(input())
str_dict= {}

for i in range(N):
    a = input().split()
    if a[0] == "insert":
        str_dict[a[1]] = i
    else:
        if a[1] in str_dict.keys():
            print("yes")
        else:
            print("no") N = int(input()) N int(input()) int input() input str_dict= {} str_dict {} for i in range(N):
    a = input().split()
    if a[0] == "insert":
        str_dict[a[1]] = i
    else:
        if a[1] in str_dict.keys():
            print("yes")
        else:
            print("no") i range(N) range N a = input().split() a input().split() ().split () input split if a[0] == "insert":
        str_dict[a[1]] = i
    else:
        if a[1] in str_dict.keys():
            print("yes")
        else:
            print("no") a[0] == "insert" a[0] a 0 "insert" str_dict[a[1]] = i str_dict[a[1]] str_dict a[1] a 1 i if a[1] in str_dict.keys():
            print("yes")
        else:
            print("no") a[1] in str_dict.keys() a[1] a 1 str_dict.keys() str_dict.keys str_dict keys print("yes") print "yes" print("no") print "no" str_dict= {} {} str_dict a = input().split() input().split() a N = int(input()) int(input()) N
N = int(input())
str_dict= {}

for i in range(N):
    a = input().split()
    if a[0] == "insert":
        str_dict[a[1]] = i
    else:
        if a[1] in str_dict.keys():
            print("yes")
        else:
            print("no")
