n = int(input())

l = set()

for _ in range(n):
    command, s = input().split()
    if command == "insert":
        l.add(s)
    else:
        if s in l:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input l = set() l set() set for _ in range(n):
    command, s = input().split()
    if command == "insert":
        l.add(s)
    else:
        if s in l:
            print("yes")
        else:
            print("no") _ range(n) range n command, s = input().split() command input().split() ().split () input split s if command == "insert":
        l.add(s)
    else:
        if s in l:
            print("yes")
        else:
            print("no") command == "insert" command "insert" l.add(s) l.add l add s if s in l:
            print("yes")
        else:
            print("no") s in l s l print("yes") print "yes" print("no") print "no" s = input().split() input().split() s command, s = input().split() input().split() command l = set() set() l n = int(input()) int(input()) n
n = int(input())

l = set()

for _ in range(n):
    command, s = input().split()
    if command == "insert":
        l.add(s)
    else:
        if s in l:
            print("yes")
        else:
            print("no")
