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

t = sys.stdin.readlines()

for i in t:
    i,op = i.split()
    if i == 'insert':
        dic.add(op)    
    else:
        if op in dic:
            print('yes')
        else:
            print('no') import sys sys n = int(input()) n int(input()) int input() input dic =set() dic set() set t = sys.stdin.readlines() t sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for i in t:
    i,op = i.split()
    if i == 'insert':
        dic.add(op)    
    else:
        if op in dic:
            print('yes')
        else:
            print('no') i t i,op = i.split() i i.split() i.split i split op if i == 'insert':
        dic.add(op)    
    else:
        if op in dic:
            print('yes')
        else:
            print('no') i == 'insert' i 'insert' dic.add(op) dic.add dic add op if op in dic:
            print('yes')
        else:
            print('no') op in dic op dic print('yes') print 'yes' print('no') print 'no' op = i.split() i.split() op n = int(input()) int(input()) n dic =set() set() dic t = sys.stdin.readlines() sys.stdin.readlines() t i,op = i.split() i.split() i
import sys
n = int(input())
dic =set()

t = sys.stdin.readlines()

for i in t:
    i,op = i.split()
    if i == 'insert':
        dic.add(op)    
    else:
        if op in dic:
            print('yes')
        else:
            print('no')