import collections

hoge = collections.defaultdict(lambda: 'no')
num = int(input())

for _ in range(num):
    command, key = input().split()
    if command == 'insert':
        hoge[key] = 'yes'
    else:
        print(hoge[key]) import collections collections hoge = collections.defaultdict(lambda: 'no') hoge collections.defaultdict(lambda: 'no') collections.defaultdict collections defaultdict lambda: 'no' 'no' num = int(input()) num int(input()) int input() input for _ in range(num):
    command, key = input().split()
    if command == 'insert':
        hoge[key] = 'yes'
    else:
        print(hoge[key]) _ range(num) range num command, key = input().split() command input().split() ().split () input split key if command == 'insert':
        hoge[key] = 'yes'
    else:
        print(hoge[key]) command == 'insert' command 'insert' hoge[key] = 'yes' hoge[key] hoge key 'yes' print(hoge[key]) print hoge[key] hoge key num = int(input()) int(input()) num command, key = input().split() input().split() command key = input().split() input().split() key hoge = collections.defaultdict(lambda: 'no') collections.defaultdict(lambda: 'no') hoge
import collections

hoge = collections.defaultdict(lambda: 'no')
num = int(input())

for _ in range(num):
    command, key = input().split()
    if command == 'insert':
        hoge[key] = 'yes'
    else:
        print(hoge[key])
