
def main():
    s = set()
    n = int(input())
    for _ in range(n):
        com = input().split()
        if com[0] == 'insert':s.add(com[1])
        else :
            if com[1] in s:print('yes')
            else          :print('no')


if __name__ == '__main__':
    main()

 def main():
    s = set()
    n = int(input())
    for _ in range(n):
        com = input().split()
        if com[0] == 'insert':s.add(com[1])
        else :
            if com[1] in s:print('yes')
            else          :print('no') main s = set() s set() set n = int(input()) n int(input()) int input() input for _ in range(n):
        com = input().split()
        if com[0] == 'insert':s.add(com[1])
        else :
            if com[1] in s:print('yes')
            else          :print('no') _ range(n) range n com = input().split() com input().split() ().split () input split if com[0] == 'insert':s.add(com[1])
        else :
            if com[1] in s:print('yes')
            else          :print('no') com[0] == 'insert' com[0] com 0 'insert' if com[1] in s:print('yes')
            else          :print('no') com[1] in s com[1] com 1 s if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    s = set()
    n = int(input())
    for _ in range(n):
        com = input().split()
        if com[0] == 'insert':s.add(com[1])
        else :
            if com[1] in s:print('yes')
            else          :print('no') def main():
    s = set()
    n = int(input())
    for _ in range(n):
        com = input().split()
        if com[0] == 'insert':s.add(com[1])
        else :
            if com[1] in s:print('yes')
            else          :print('no') main

def main():
    s = set()
    n = int(input())
    for _ in range(n):
        com = input().split()
        if com[0] == 'insert':s.add(com[1])
        else :
            if com[1] in s:print('yes')
            else          :print('no')


if __name__ == '__main__':
    main()


