n = int(input())
d = set() 
result = []
for _ in range(n):
    command, s = input().split()
    if command == 'insert':
        d.add(s)
    elif command == 'find':
        if s in d:
            result.append('yes')
        else:
            result.append('no')

for r in result:
    print(r)
 n = int(input()) n int(input()) int input() input d = set() d set() set result = [] result [] for _ in range(n):
    command, s = input().split()
    if command == 'insert':
        d.add(s)
    elif command == 'find':
        if s in d:
            result.append('yes')
        else:
            result.append('no') _ range(n) range n command, s = input().split() command input().split() ().split () input split s if command == 'insert':
        d.add(s)
    elif command == 'find':
        if s in d:
            result.append('yes')
        else:
            result.append('no') command == 'insert' command 'insert' d.add(s) d.add d add s elif command == 'find':
        if s in d:
            result.append('yes')
        else:
            result.append('no') command == 'find' command 'find' if s in d:
            result.append('yes')
        else:
            result.append('no') s in d s d result.append('yes') result.append result append 'yes' result.append('no') result.append result append 'no' for r in result:
    print(r) r result print(r) print r d = set() set() d command, s = input().split() input().split() command result = [] [] result n = int(input()) int(input()) n s = input().split() input().split() s
n = int(input())
d = set() 
result = []
for _ in range(n):
    command, s = input().split()
    if command == 'insert':
        d.add(s)
    elif command == 'find':
        if s in d:
            result.append('yes')
        else:
            result.append('no')

for r in result:
    print(r)

