#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def process(commands):
    d = set()
    for c in commands:
        cpair = c.split()
        if cpair[0] == "insert":
            d.add(cpair[1])
        elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r)


def main():
    n = int(input())
    commands = [input() for i in range(n)]
    process(commands)


if __name__ == "__main__":
    main() def process(commands):
    d = set()
    for c in commands:
        cpair = c.split()
        if cpair[0] == "insert":
            d.add(cpair[1])
        elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r) process d = set() d set() set for c in commands:
        cpair = c.split()
        if cpair[0] == "insert":
            d.add(cpair[1])
        elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r) c commands cpair = c.split() cpair c.split() c.split c split if cpair[0] == "insert":
            d.add(cpair[1])
        elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r) cpair[0] == "insert" cpair[0] cpair 0 "insert" d.add(cpair[1]) d.add d add cpair[1] cpair 1 elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r) cpair[0] == "find" cpair[0] cpair 0 "find" r = "yes" if cpair[1] in d else "no" r "yes" if cpair[1] in d else "no" cpair[1] in d cpair[1] cpair 1 d "yes" "no" print(r) print r commands commands def main():
    n = int(input())
    commands = [input() for i in range(n)]
    process(commands) main n = int(input()) n int(input()) int input() input input() for i in range(n) for i in range(n) i range(n) range n for i in range(n) input() input commands = [input() for i in range(n)] commands [input() for i in range(n)] process(commands) process commands if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    commands = [input() for i in range(n)]
    process(commands) def main():
    n = int(input())
    commands = [input() for i in range(n)]
    process(commands) main def process(commands):
    d = set()
    for c in commands:
        cpair = c.split()
        if cpair[0] == "insert":
            d.add(cpair[1])
        elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r) def process(commands):
    d = set()
    for c in commands:
        cpair = c.split()
        if cpair[0] == "insert":
            d.add(cpair[1])
        elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r) process
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def process(commands):
    d = set()
    for c in commands:
        cpair = c.split()
        if cpair[0] == "insert":
            d.add(cpair[1])
        elif cpair[0] == "find":
            r = "yes" if cpair[1] in d else "no"
            print(r)


def main():
    n = int(input())
    commands = [input() for i in range(n)]
    process(commands)


if __name__ == "__main__":
    main()