n = int(raw_input())
d = {}
for i in range(n):
    p,q = map(str,raw_input().split())
    if p == "insert":
        d[q] = 1
    elif p == "find":
        if(q in d):
            print "yes"
        else:
            print "no" n = int(raw_input()) n int(raw_input()) int raw_input() raw_input d = {} d {} for i in range(n):
    p,q = map(str,raw_input().split())
    if p == "insert":
        d[q] = 1
    elif p == "find":
        if(q in d):
            print "yes"
        else:
            print "no" i range(n) range n p,q = map(str,raw_input().split()) p map(str,raw_input().split()) map str raw_input().split() ().split () raw_input split q if p == "insert":
        d[q] = 1
    elif p == "find":
        if(q in d):
            print "yes"
        else:
            print "no" p == "insert" p "insert" d[q] = 1 d[q] d q 1 elif p == "find":
        if(q in d):
            print "yes"
        else:
            print "no" p == "find" p "find" if(q in d):
            print "yes"
        else:
            print "no" q in d q d print print d = {} {} d p,q = map(str,raw_input().split()) map(str,raw_input().split()) p n = int(raw_input()) int(raw_input()) n q = map(str,raw_input().split()) map(str,raw_input().split()) q
n = int(raw_input())
d = {}
for i in range(n):
    p,q = map(str,raw_input().split())
    if p == "insert":
        d[q] = 1
    elif p == "find":
        if(q in d):
            print "yes"
        else:
            print "no"