def main():
    n = int(input())
    d = set([])


    for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no')

if __name__ == "__main__":
    main() def main():
    n = int(input())
    d = set([])


    for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no') main n = int(input()) n int(input()) int input() input d = set([]) d set([]) set [] for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no') i range(n) range n command, string = input().split() command input().split() ().split () input split string if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no') command == 'insert' command 'insert' d.add(string) d.add d add string elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no') command == 'find' command 'find' if string in d:
                print('yes')
            else:
                print('no') string in d string d print('yes') print 'yes' print('no') print 'no' if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    d = set([])


    for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no') def main():
    n = int(input())
    d = set([])


    for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no') main
def main():
    n = int(input())
    d = set([])


    for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no')

if __name__ == "__main__":
    main()