#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

class AVLTree {

    int node_count = 0;

    struct Node {
        int val, count, height, size;
        Node *left, *right;
        Node(int v) {
            val = v;
            count = 1;
            size = 1;
            height = 1;
            left = nullptr;
            right = nullptr;
        }
    };

    Node* root = nullptr;

    int count_util(Node* root, int val) {
        if (!root) {
            return 0;
        }
        if (root->val == val) {
            return root->count;
        }
        else if (root->val > val) {
            return count_util(root->left, val);
        }
        else {
            return count_util(root->right, val);
        }
    }

    int order_util(Node* root, int val) {
        if (!root) {
            return 0;
        }
        if (root->val == val) {
            if (root->left) {
                return root->left->size;
            }
            return 0;
        }
        if (root->val > val) {
            return order_util(root->left, val);
        }
        else {
            int left_size = 0;
            if (root->left) {
                left_size = root->left->size;
            }
            return left_size + root->count + order_util(root->right, val);
        }
    }

    Node* right_rotate(Node* A) {
        /*    A              B 
             / \           /   \
            B  Ar   ->    C     A
           / \           / \   / \
          C   Br        Cl Cr Br Ar 
         / \
        Cl Cr 
        
        */

        Node* B = A->left;
        Node* Br = B->right;
        B->right = A;
        A->left = Br;
        A->height = 1 + max(height(A->left), height(A->right));
        B->height = 1 + max(height(B->left), height(B->right));
        A->size = 1 + size(A->left) + size(A->right);
        B->size = 1 + size(B->left) + size(B->right);
        return B;
    }

    Node* left_rotate(Node* A) {
        /*  A                 B 
          /  \              /   \ 
         Al   B     ->     A     C
             / \          / \   / \
            Bl  C        Al Bl Cl Cr 
               / \
              Cl  Cr
        */

        Node* B = A->right;
        Node* Bl = B->left;
        B->left = A;
        A->right = Bl;
        A->height = 1 + max(height(A->left), height(A->right));
        B->height = 1 + max(height(B->left), height(B->right));
        A->size = 1 + size(A->left) + size(A->right);
        B->size = 1 + size(B->left) + size(B->right);
        return B;
    }

    int size(Node* root) {
        if (!root) {
            return 0;
        }
        return root->size;
    }

    Node* balance_it_out(Node* root) {
        int bf = height(root->left) - height(root->right);
        if (bf < -1) {
            if (height(root->right->left) >= height(root->right->right)) { //RL
                root->right = right_rotate(root->right);
                root = left_rotate(root);
            }
            else { //RR 
                root = left_rotate(root);
            } 
        }
        else if (bf > 1) {
            if (height(root->left->right) >= height(root->left->left)) { //LR
                root->left = left_rotate(root->left);
                root = right_rotate(root);
            }
            else { //LL 
                root = right_rotate(root);
            } 
        }
        return root;
    }

    int height(Node* root) {
        if (!root) {
            return 0;
        }
        return root->height;
    }

    Node* insert_util(Node* root, int val) {
        if (!root) {
            Node* node = new Node(val);
            node_count++;
            return node;
        }
        if (root->val == val) {
            root->count++;
            root->size++;
            return root;
        }
        if (root->val > val) {
            root->left = insert_util(root->left, val);
        }
        else {
            root->right = insert_util(root->right, val);
        }
        root = balance_it_out(root);
        root->size++;
        root->height = 1 + max(height(root->left), height(root->right));
        return root;
    }

    Node* remove_util(Node* root, int val) {
        if (!root) {
            return nullptr;
        }
        if (root->val == val) {
            if (root->count > 1) {
                root->count--;
                return root;
            }
            node_count--;
            if (!root->left && !root->right) {
                delete root;
                return nullptr;
            }
            if (!root->left) {
                Node* right = root->right;
                delete root;
                return right;
            }
            if (!root->right) {
                Node* left = root->left;
                delete root;
                return left;
            }
            int inorder_succ = inorder_successor(root->right);
            root->val = inorder_succ;
            root->right = remove_util(root->right, inorder_succ);
        }
        else if (root->val > val) {
            root->left = remove_util(root->left, val);
        }
        else {
            root->right = remove_util(root->right, val);
        }
        root->size--;
        root = balance_it_out(root);
        root->height = 1 + max(height(root->left), height(root->right));
        return root;
    }

    int inorder_successor(Node* root) {
        while (root->left) {
            root = root->left;
        }
        return root->val;
    }

    public:

    void insert(int val) {
        root = insert_util(root, val);
    }

    void remove(int val) {
        if (count(val) == 0) {
            return;
        }
        root = remove_util(root, val);
    }

    int order(int val) {
        if (count(val) == 0) {
            return -1;
        }
        return order_util(root, val);
    }

    int count(int val) {
        return count_util(root, val);
    }

    int size() {
        if (!root) {
            return 0;
        }
        return root->size;
    }

    int count_distinct() {
        return node_count;
    }
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n, a;
    cin >> n;
    AVLTree st;
    for (ll i = 0; i < n; i++) {
        cin >> a;
        st.insert(a);
    }
    cout << (st.count_distinct() == n ? "YES" : "NO");
    return 0; 
}


Measured memory_bytes: 9600