import sys

n = int(input())
dic = {}

for i in range(n):
    c, s = sys.stdin.readline().split()
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no') import sys sys n = int(input()) n int(input()) int input() input dic = {} dic {} for i in range(n):
    c, s = sys.stdin.readline().split()
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no') i range(n) range n c, s = sys.stdin.readline().split() c sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split s if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no') c == 'insert' c 'insert' dic[s] = 0 dic[s] dic s 0 if s in dic:
            print('yes')
        else:
            print('no') s in dic s dic print('yes') print 'yes' print('no') print 'no' n = int(input()) int(input()) n dic = {} {} dic s = sys.stdin.readline().split() sys.stdin.readline().split() s c, s = sys.stdin.readline().split() sys.stdin.readline().split() c
import sys

n = int(input())
dic = {}

for i in range(n):
    c, s = sys.stdin.readline().split()
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no')