import sys

n = int(input())
s = set()
for i in range(n):
    ins = input().split()
    if ins[0] == "insert":
        s.add(ins[1])
    elif ins[0] == "find":
        if ins[1] in s:
            print("yes")
        else:
            print("no") import sys sys n = int(input()) n int(input()) int input() input s = set() s set() set for i in range(n):
    ins = input().split()
    if ins[0] == "insert":
        s.add(ins[1])
    elif ins[0] == "find":
        if ins[1] in s:
            print("yes")
        else:
            print("no") i range(n) range n ins = input().split() ins input().split() ().split () input split if ins[0] == "insert":
        s.add(ins[1])
    elif ins[0] == "find":
        if ins[1] in s:
            print("yes")
        else:
            print("no") ins[0] == "insert" ins[0] ins 0 "insert" s.add(ins[1]) s.add s add ins[1] ins 1 elif ins[0] == "find":
        if ins[1] in s:
            print("yes")
        else:
            print("no") ins[0] == "find" ins[0] ins 0 "find" if ins[1] in s:
            print("yes")
        else:
            print("no") ins[1] in s ins[1] ins 1 s print("yes") print "yes" print("no") print "no" n = int(input()) int(input()) n ins = input().split() input().split() ins s = set() set() s
import sys

n = int(input())
s = set()
for i in range(n):
    ins = input().split()
    if ins[0] == "insert":
        s.add(ins[1])
    elif ins[0] == "find":
        if ins[1] in s:
            print("yes")
        else:
            print("no")