if __name__ == '__main__':
    from collections import deque
    n = int(input())
    dic = {}

    for i in range(n):
        x = input().split()
        if x[0] == "insert":
            dic[x[1]] = 1
        if x[0] == "find":
            if x[1] in dic:
                print('yes')
            else:
                print('no')
 if __name__ == '__main__':
    from collections import deque
    n = int(input())
    dic = {}

    for i in range(n):
        x = input().split()
        if x[0] == "insert":
            dic[x[1]] = 1
        if x[0] == "find":
            if x[1] in dic:
                print('yes')
            else:
                print('no') __name__ == '__main__' __name__ '__main__' from collections import deque n = int(input()) n int(input()) int input() input dic = {} dic {} for i in range(n):
        x = input().split()
        if x[0] == "insert":
            dic[x[1]] = 1
        if x[0] == "find":
            if x[1] in dic:
                print('yes')
            else:
                print('no') i range(n) range n x = input().split() x input().split() ().split () input split if x[0] == "insert":
            dic[x[1]] = 1
         x[0] == "insert" x[0] x 0 "insert" dic[x[1]] = 1 dic[x[1]] dic x[1] x 1 1 if x[0] == "find":
            if x[1] in dic:
                print('yes')
            else:
                print('no') x[0] == "find" x[0] x 0 "find" if x[1] in dic:
                print('yes')
            else:
                print('no') x[1] in dic x[1] x 1 dic print('yes') print 'yes' print('no') print 'no' n = int(input()) int(input()) n dic = {} {} dic x = input().split() input().split() x
if __name__ == '__main__':
    from collections import deque
    n = int(input())
    dic = {}

    for i in range(n):
        x = input().split()
        if x[0] == "insert":
            dic[x[1]] = 1
        if x[0] == "find":
            if x[1] in dic:
                print('yes')
            else:
                print('no')

