# ALDS1 : Dictionary

def main():
    n = input()
    dic = {}
    for i in xrange(n):
        command, ope = raw_input().split()
        if command == "insert":
            dic[ope] = 1
        elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no"

if __name__ == '__main__':
    main() def main():
    n = input()
    dic = {}
    for i in xrange(n):
        command, ope = raw_input().split()
        if command == "insert":
            dic[ope] = 1
        elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no" main n = input() n input() input dic = {} dic {} for i in xrange(n):
        command, ope = raw_input().split()
        if command == "insert":
            dic[ope] = 1
        elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no" i xrange(n) xrange n command, ope = raw_input().split() command raw_input().split() ().split () raw_input split ope if command == "insert":
            dic[ope] = 1
        elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no" command == "insert" command "insert" dic[ope] = 1 dic[ope] dic ope 1 elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no" command =="find" command "find" if ope in dic:
                print "yes"
            else:
                print "no" ope in dic ope dic print print if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = input()
    dic = {}
    for i in xrange(n):
        command, ope = raw_input().split()
        if command == "insert":
            dic[ope] = 1
        elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no" def main():
    n = input()
    dic = {}
    for i in xrange(n):
        command, ope = raw_input().split()
        if command == "insert":
            dic[ope] = 1
        elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no" main
# ALDS1 : Dictionary

def main():
    n = input()
    dic = {}
    for i in xrange(n):
        command, ope = raw_input().split()
        if command == "insert":
            dic[ope] = 1
        elif command =="find":
            if ope in dic:
                print "yes"
            else:
                print "no"

if __name__ == '__main__':
    main()