my_set = set()

n = int(input())
for _ in range(n):
    command, dna = input().split()
    if command == 'insert':
        my_set.add(dna)
    elif dna in my_set:
        print('yes')
    else:
        print('no') my_set = set() my_set set() set n = int(input()) n int(input()) int input() input for _ in range(n):
    command, dna = input().split()
    if command == 'insert':
        my_set.add(dna)
    elif dna in my_set:
        print('yes')
    else:
        print('no') _ range(n) range n command, dna = input().split() command input().split() ().split () input split dna if command == 'insert':
        my_set.add(dna)
    elif dna in my_set:
        print('yes')
    else:
        print('no') command == 'insert' command 'insert' my_set.add(dna) my_set.add my_set add dna elif dna in my_set:
        print('yes')
     dna in my_set dna my_set print('yes') print 'yes' print('no') print 'no' n = int(input()) int(input()) n my_set = set() set() my_set dna = input().split() input().split() dna command, dna = input().split() input().split() command
my_set = set()

n = int(input())
for _ in range(n):
    command, dna = input().split()
    if command == 'insert':
        my_set.add(dna)
    elif dna in my_set:
        print('yes')
    else:
        print('no')
