import sys
input()
d = set()
for l in sys.stdin:
	c,s = l.split()
	if c[0] == 'i':
		d.add(s)
	else:
		print('yes' if s in d else 'no') import sys sys input() input d = set() d set() set for l in sys.stdin:
	c,s = l.split()
	if c[0] == 'i':
		d.add(s)
	else:
		print('yes' if s in d else 'no') l sys.stdin sys stdin c,s = l.split() c l.split() l.split l split s if c[0] == 'i':
		d.add(s)
	else:
		print('yes' if s in d else 'no') c[0] == 'i' c[0] c 0 'i' d.add(s) d.add d add s print('yes' if s in d else 'no') print 'yes' if s in d else 'no' s in d s d 'yes' 'no' d = set() set() d c,s = l.split() l.split() c s = l.split() l.split() s
import sys
input()
d = set()
for l in sys.stdin:
	c,s = l.split()
	if c[0] == 'i':
		d.add(s)
	else:
		print('yes' if s in d else 'no')
