n = int(input())

dna = set()
for i in range(n):
    command = input().split()
    if command[0] == 'insert':
        dna.add(command[1])
    else:
        print('yes' if command[1] in dna else 'no') n = int(input()) n int(input()) int input() input dna = set() dna set() set for i in range(n):
    command = input().split()
    if command[0] == 'insert':
        dna.add(command[1])
    else:
        print('yes' if command[1] in dna else 'no') i range(n) range n command = input().split() command input().split() ().split () input split if command[0] == 'insert':
        dna.add(command[1])
    else:
        print('yes' if command[1] in dna else 'no') command[0] == 'insert' command[0] command 0 'insert' dna.add(command[1]) dna.add dna add command[1] command 1 print('yes' if command[1] in dna else 'no') print 'yes' if command[1] in dna else 'no' command[1] in dna command[1] command 1 dna 'yes' 'no' n = int(input()) int(input()) n dna = set() set() dna command = input().split() input().split() command
n = int(input())

dna = set()
for i in range(n):
    command = input().split()
    if command[0] == 'insert':
        dna.add(command[1])
    else:
        print('yes' if command[1] in dna else 'no')