n = input()

dict_ = set()
for _ in xrange(n):
    cmd, str_ = raw_input().split()
    if cmd == "insert":
        dict_.add(str_)
    elif cmd == "find":
        if str_ in dict_:
            print "yes"
        else:
            print "no" n = input() n input() input dict_ = set() dict_ set() set for _ in xrange(n):
    cmd, str_ = raw_input().split()
    if cmd == "insert":
        dict_.add(str_)
    elif cmd == "find":
        if str_ in dict_:
            print "yes"
        else:
            print "no" _ xrange(n) xrange n cmd, str_ = raw_input().split() cmd raw_input().split() ().split () raw_input split str_ if cmd == "insert":
        dict_.add(str_)
    elif cmd == "find":
        if str_ in dict_:
            print "yes"
        else:
            print "no" cmd == "insert" cmd "insert" dict_.add(str_) dict_.add dict_ add str_ elif cmd == "find":
        if str_ in dict_:
            print "yes"
        else:
            print "no" cmd == "find" cmd "find" if str_ in dict_:
            print "yes"
        else:
            print "no" str_ in dict_ str_ dict_ print print str_ = raw_input().split() raw_input().split() str_ n = input() input() n dict_ = set() set() dict_ cmd, str_ = raw_input().split() raw_input().split() cmd
n = input()

dict_ = set()
for _ in xrange(n):
    cmd, str_ = raw_input().split()
    if cmd == "insert":
        dict_.add(str_)
    elif cmd == "find":
        if str_ in dict_:
            print "yes"
        else:
            print "no"