

def solve():
    num_lines = int(raw_input())

    s = set()
    for i in xrange(num_lines):
        command, target = raw_input().split(" ")

        if command[0] == "i":# insert
            s.add(target)
            continue

        if target in s:
            print "yes"
        else:
            print "no"


if __name__ == "__main__":
    solve() def solve():
    num_lines = int(raw_input())

    s = set()
    for i in xrange(num_lines):
        command, target = raw_input().split(" ")

        if command[0] == "i":# insert
            s.add(target)
            continue

        if target in s:
            print "yes"
        else:
            print "no" solve num_lines = int(raw_input()) num_lines int(raw_input()) int raw_input() raw_input s = set() s set() set for i in xrange(num_lines):
        command, target = raw_input().split(" ")

        if command[0] == "i":# insert
            s.add(target)
            continue

        if target in s:
            print "yes"
        else:
            print "no" i xrange(num_lines) xrange num_lines command, target = raw_input().split(" ") command raw_input().split(" ") ().split () raw_input split " " target if command[0] == "i":# insert
            s.add(target)
            continue

         command[0] == "i" command[0] command 0 "i" s.add(target) s.add s add target continue if target in s:
            print "yes"
        else:
            print "no" target in s target s print print if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    num_lines = int(raw_input())

    s = set()
    for i in xrange(num_lines):
        command, target = raw_input().split(" ")

        if command[0] == "i":# insert
            s.add(target)
            continue

        if target in s:
            print "yes"
        else:
            print "no" def solve():
    num_lines = int(raw_input())

    s = set()
    for i in xrange(num_lines):
        command, target = raw_input().split(" ")

        if command[0] == "i":# insert
            s.add(target)
            continue

        if target in s:
            print "yes"
        else:
            print "no" solve


def solve():
    num_lines = int(raw_input())

    s = set()
    for i in xrange(num_lines):
        command, target = raw_input().split(" ")

        if command[0] == "i":# insert
            s.add(target)
            continue

        if target in s:
            print "yes"
        else:
            print "no"


if __name__ == "__main__":
    solve()