#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
#check = 'insert'
n=input()
a=set()
for x in xrange(n):
    (i,f)=map(str, raw_input().split())
    if i=='insert':
        a.add(f)
    else:
        if f in a:
            print 'yes'
        else:
            print 'no' import time time import sys sys import io io import re re import math math n=input() n input() input a=set() a set() set for x in xrange(n):
    (i,f)=map(str, raw_input().split())
    if i=='insert':
        a.add(f)
    else:
        if f in a:
            print 'yes'
        else:
            print 'no' x xrange(n) xrange n (i,f)=map(str, raw_input().split()) (i,f) i f map(str, raw_input().split()) map str raw_input().split() ().split () raw_input split if i=='insert':
        a.add(f)
    else:
        if f in a:
            print 'yes'
        else:
            print 'no' i=='insert' i 'insert' a.add(f) a.add a add f if f in a:
            print 'yes'
        else:
            print 'no' f in a f a print print n=input() input() n a=set() set() a
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
#check = 'insert'
n=input()
a=set()
for x in xrange(n):
    (i,f)=map(str, raw_input().split())
    if i=='insert':
        a.add(f)
    else:
        if f in a:
            print 'yes'
        else:
            print 'no'