n = int(input())
mydic = {}
for _ in range(n):
    s,t = input().split()
    if s == "insert":
        mydic[t] = 1
    else:
        if t in mydic.keys():
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input mydic = {} mydic {} for _ in range(n):
    s,t = input().split()
    if s == "insert":
        mydic[t] = 1
    else:
        if t in mydic.keys():
            print("yes")
        else:
            print("no") _ range(n) range n s,t = input().split() s input().split() ().split () input split t if s == "insert":
        mydic[t] = 1
    else:
        if t in mydic.keys():
            print("yes")
        else:
            print("no") s == "insert" s "insert" mydic[t] = 1 mydic[t] mydic t 1 if t in mydic.keys():
            print("yes")
        else:
            print("no") t in mydic.keys() t mydic.keys() mydic.keys mydic keys print("yes") print "yes" print("no") print "no" mydic = {} {} mydic s,t = input().split() input().split() s n = int(input()) int(input()) n t = input().split() input().split() t
n = int(input())
mydic = {}
for _ in range(n):
    s,t = input().split()
    if s == "insert":
        mydic[t] = 1
    else:
        if t in mydic.keys():
            print("yes")
        else:
            print("no")
