# Aizu Problem ALDS_1_4_C: Dictionary
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


D = set()
N = int(input())
for _ in range(N):
    cmd, string = input().split()
    if cmd == "insert":
        D.add(string)
    elif cmd == "find":
        print("yes" if string in D else "no") import sys, math, os sys math os PYDEV = os.environ.get('PYDEV') PYDEV os.environ.get('PYDEV') os.environ.get os.environ os environ get 'PYDEV' if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt") PYDEV=="True" PYDEV "True" sys.stdin = open("sample-input.txt", "rt") sys.stdin sys stdin open("sample-input.txt", "rt") open "sample-input.txt" "rt" D = set() D set() set N = int(input()) N int(input()) int input() input for _ in range(N):
    cmd, string = input().split()
    if cmd == "insert":
        D.add(string)
    elif cmd == "find":
        print("yes" if string in D else "no") _ range(N) range N cmd, string = input().split() cmd input().split() ().split () input split string if cmd == "insert":
        D.add(string)
    elif cmd == "find":
        print("yes" if string in D else "no") cmd == "insert" cmd "insert" D.add(string) D.add D add string elif cmd == "find":
        print("yes" if string in D else "no") cmd == "find" cmd "find" print("yes" if string in D else "no") print "yes" if string in D else "no" string in D string D "yes" "no" N = int(input()) int(input()) N D = set() set() D string = input().split() input().split() string cmd, string = input().split() input().split() cmd PYDEV = os.environ.get('PYDEV') os.environ.get('PYDEV') PYDEV
# Aizu Problem ALDS_1_4_C: Dictionary
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


D = set()
N = int(input())
for _ in range(N):
    cmd, string = input().split()
    if cmd == "insert":
        D.add(string)
    elif cmd == "find":
        print("yes" if string in D else "no")