import sys
d={}
input()
for e in sys.stdin:
 c,g=e.split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) import sys sys d={} d {} input() input for e in sys.stdin:
 c,g=e.split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) e sys.stdin sys stdin c,g=e.split() c e.split() e.split e split g if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) 'i'==c[0] 'i' c[0] c 0 d={} {} d g=e.split() e.split() g c,g=e.split() e.split() c
import sys
d={}
input()
for e in sys.stdin:
 c,g=e.split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d])
