import sys

n = int(input())
dic = set()

for i in range(n):
    c, s = sys.stdin.readline().split()
    if c == 'insert':
        dic.add(s)
    else:
        if s in dic:
            print('yes')
        else:
            print('no') import sys sys n = int(input()) n int(input()) int input() input dic = set() dic set() set for i in range(n):
    c, s = sys.stdin.readline().split()
    if c == 'insert':
        dic.add(s)
    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.add(s)
    else:
        if s in dic:
            print('yes')
        else:
            print('no') c == 'insert' c 'insert' dic.add(s) dic.add dic add s if s in dic:
            print('yes')
        else:
            print('no') s in dic s dic print('yes') print 'yes' print('no') print 'no' s = sys.stdin.readline().split() sys.stdin.readline().split() s n = int(input()) int(input()) n dic = set() set() dic c, s = sys.stdin.readline().split() sys.stdin.readline().split() c
import sys

n = int(input())
dic = set()

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