n = int(input())
d = {}
for i in range(n):
    cmd, s = input().split()
    if cmd == "insert":
        d.update([(s, 0)])
    else:
        if s in d:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input d = {} d {} for i in range(n):
    cmd, s = input().split()
    if cmd == "insert":
        d.update([(s, 0)])
    else:
        if s in d:
            print("yes")
        else:
            print("no") i range(n) range n cmd, s = input().split() cmd input().split() ().split () input split s if cmd == "insert":
        d.update([(s, 0)])
    else:
        if s in d:
            print("yes")
        else:
            print("no") cmd == "insert" cmd "insert" d.update([(s, 0)]) d.update d update [(s, 0)] (s, 0) s 0 if s in d:
            print("yes")
        else:
            print("no") s in d s d print("yes") print "yes" print("no") print "no" n = int(input()) int(input()) n cmd, s = input().split() input().split() cmd d = {} {} d s = input().split() input().split() s
n = int(input())
d = {}
for i in range(n):
    cmd, s = input().split()
    if cmd == "insert":
        d.update([(s, 0)])
    else:
        if s in d:
            print("yes")
        else:
            print("no")