n = input()
S = set()
for i in xrange(n):
    inst, s = raw_input().split()
    if inst == "insert":
        S.add(s)
    else:
        if s in S:
            print "yes"
        else:
            print "no" n = input() n input() input S = set() S set() set for i in xrange(n):
    inst, s = raw_input().split()
    if inst == "insert":
        S.add(s)
    else:
        if s in S:
            print "yes"
        else:
            print "no" i xrange(n) xrange n inst, s = raw_input().split() inst raw_input().split() ().split () raw_input split s if inst == "insert":
        S.add(s)
    else:
        if s in S:
            print "yes"
        else:
            print "no" inst == "insert" inst "insert" S.add(s) S.add S add s if s in S:
            print "yes"
        else:
            print "no" s in S s S print print n = input() input() n s = raw_input().split() raw_input().split() s S = set() set() S inst, s = raw_input().split() raw_input().split() inst
n = input()
S = set()
for i in xrange(n):
    inst, s = raw_input().split()
    if inst == "insert":
        S.add(s)
    else:
        if s in S:
            print "yes"
        else:
            print "no"