import sys
n = int(input())
input_lines = [input() for i in range(n)]
char_set = set()
for i in range(n):
    line = input_lines[i].split()
    if line[0] == 'insert':
        char_set.add(line[1])
    elif line[0] == 'find' and line[1] in char_set:
        print('yes')
    else:
        print('no') import sys sys n = int(input()) n int(input()) int input() input input() for i in range(n) for i in range(n) i range(n) range n for i in range(n) input() input input_lines = [input() for i in range(n)] input_lines [input() for i in range(n)] char_set = set() char_set set() set for i in range(n):
    line = input_lines[i].split()
    if line[0] == 'insert':
        char_set.add(line[1])
    elif line[0] == 'find' and line[1] in char_set:
        print('yes')
    else:
        print('no') i range(n) range n line = input_lines[i].split() line input_lines[i].split() [i].split [i] input_lines i split if line[0] == 'insert':
        char_set.add(line[1])
    elif line[0] == 'find' and line[1] in char_set:
        print('yes')
    else:
        print('no') line[0] == 'insert' line[0] line 0 'insert' char_set.add(line[1]) char_set.add char_set add line[1] line 1 elif line[0] == 'find' and line[1] in char_set:
        print('yes')
     line[0] == 'find' and line[1] in char_set line[0] == 'find' line[0] line 0 'find' line[1] in char_set line[1] line 1 char_set print('yes') print 'yes' print('no') print 'no' n = int(input()) int(input()) n line = input_lines[i].split() input_lines[i].split() line char_set = set() set() char_set input_lines = [input() for i in range(n)] [input() for i in range(n)] input_lines
import sys
n = int(input())
input_lines = [input() for i in range(n)]
char_set = set()
for i in range(n):
    line = input_lines[i].split()
    if line[0] == 'insert':
        char_set.add(line[1])
    elif line[0] == 'find' and line[1] in char_set:
        print('yes')
    else:
        print('no')
