t = set()
m = int(input())
for i in range(m):
    cmd, key = input().split()
    if cmd == "insert":
        t.add(key)
    else:
        if key in t:
            print("yes")
        else:
            print("no") t = set() t set() set m = int(input()) m int(input()) int input() input for i in range(m):
    cmd, key = input().split()
    if cmd == "insert":
        t.add(key)
    else:
        if key in t:
            print("yes")
        else:
            print("no") i range(m) range m cmd, key = input().split() cmd input().split() ().split () input split key if cmd == "insert":
        t.add(key)
    else:
        if key in t:
            print("yes")
        else:
            print("no") cmd == "insert" cmd "insert" t.add(key) t.add t add key if key in t:
            print("yes")
        else:
            print("no") key in t key t print("yes") print "yes" print("no") print "no" t = set() set() t key = input().split() input().split() key cmd, key = input().split() input().split() cmd m = int(input()) int(input()) m
t = set()
m = int(input())
for i in range(m):
    cmd, key = input().split()
    if cmd == "insert":
        t.add(key)
    else:
        if key in t:
            print("yes")
        else:
            print("no")