def insert(S, string):
    S.add(string)

def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no'

n = input()

S = set()

for i in range(n):
    tmp1, tmp2  = map(str, raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!' def insert(S, string):
    S.add(string) insert S.add(string) S.add S add string S S string string def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no' find if string in S:
        print 'yes'
    else:
        print 'no' string in S string S print print S S string string n = input() n input() input S = set() S set() set for i in range(n):
    tmp1, tmp2  = map(str, raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!' i range(n) range n tmp1, tmp2  = map(str, raw_input().split()) tmp1 map(str, raw_input().split()) map str raw_input().split() ().split () raw_input split tmp2 if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!' tmp1 == 'insert' tmp1 'insert' insert(S, tmp2) insert S tmp2 elif tmp1 == 'find':
        find(S, tmp2)
     tmp1 == 'find' tmp1 'find' find(S, tmp2) find S tmp2 print def insert(S, string):
    S.add(string) def insert(S, string):
    S.add(string) insert n = input() input() n tmp1, tmp2  = map(str, raw_input().split()) map(str, raw_input().split()) tmp1 def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no' def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no' find tmp2  = map(str, raw_input().split()) map(str, raw_input().split()) tmp2 S = set() set() S
def insert(S, string):
    S.add(string)

def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no'

n = input()

S = set()

for i in range(n):
    tmp1, tmp2  = map(str, raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!'