# AOJ ALDS1_4_C Dictionary
# Python3 2018.7.3 bal4u

import sys
from sys import stdin
input = stdin.readline

dic = {}
n = int(input())
for i in range(n):
	s = input()
	if s[0] == 'i': dic[s[7:]] = 1
	else: print("yes" if s[5:] in dic else "no") import sys sys from sys import stdin input = stdin.readline input stdin.readline stdin readline dic = {} dic {} n = int(input()) n int(input()) int input() input for i in range(n):
	s = input()
	if s[0] == 'i': dic[s[7:]] = 1
	else: print("yes" if s[5:] in dic else "no") i range(n) range n s = input() s input() input if s[0] == 'i': dic[s[7:]] = 1
	else: print("yes" if s[5:] in dic else "no") s[0] == 'i' s[0] s 0 'i' input = stdin.readline stdin.readline input n = int(input()) int(input()) n s = input() input() s dic = {} {} dic
# AOJ ALDS1_4_C Dictionary
# Python3 2018.7.3 bal4u

import sys
from sys import stdin
input = stdin.readline

dic = {}
n = int(input())
for i in range(n):
	s = input()
	if s[0] == 'i': dic[s[7:]] = 1
	else: print("yes" if s[5:] in dic else "no")
