from sys import stdin
n = int(input())
dict = {}
for i in range(n):
    line = stdin.readline()
    if line[0:6] == 'insert':
        dict[line[7:]] = 1
    else:
        if line[5:] in dict:
            print('yes')
        else:
            print('no') from sys import stdin n = int(input()) n int(input()) int input() input dict = {} dict {} for i in range(n):
    line = stdin.readline()
    if line[0:6] == 'insert':
        dict[line[7:]] = 1
    else:
        if line[5:] in dict:
            print('yes')
        else:
            print('no') i range(n) range n line = stdin.readline() line stdin.readline() stdin.readline stdin readline if line[0:6] == 'insert':
        dict[line[7:]] = 1
    else:
        if line[5:] in dict:
            print('yes')
        else:
            print('no') line[0:6] == 'insert' line[0:6] line 0:6 0 6 'insert' dict[line[7:]] = 1 dict[line[7:]] dict line[7:] line 7: 7 1 if line[5:] in dict:
            print('yes')
        else:
            print('no') line[5:] in dict line[5:] line 5: 5 dict print('yes') print 'yes' print('no') print 'no' n = int(input()) int(input()) n line = stdin.readline() stdin.readline() line dict = {} {} dict
from sys import stdin
n = int(input())
dict = {}
for i in range(n):
    line = stdin.readline()
    if line[0:6] == 'insert':
        dict[line[7:]] = 1
    else:
        if line[5:] in dict:
            print('yes')
        else:
            print('no')
