#include <stdio.h>                                                                                                                                                               
#include <stdlib.h>                                                                                                                                                              
                                                                                                                                                                                 
static int                                                                                                                                                                       
ll_compare (const void *a, const void *b) {                                                                                                                                      
    return *(long long*)a - *(long long*)b;                                                                                                                                      
}
                                                                                                                                                                                 
int main (void) {
    long long n;                                                                                                                                                                 
    scanf("%lld", &n);                                                                                                                                                           
    long long a[n];                                                                                                                                                              
    for ( long long i=0; i<n; i++ )                                                                                                                                              
        scanf("%lld", &a[i]);                                                                                                                                                    
    qsort(a, n, sizeof(long long), ll_compare);                                                                                                                                  
    for ( long long i=1; i<n; i++ ) {                                                                                                                                            
        if ( a[i-1] == a[i] ) {                                                                                                                                                  
            printf("NO\n");                                                                                                                                                      
            goto END;                                                                                                                                                            
        }                                                                                                                                                                        
    }                                                                                                                                                                            
    printf("YES\n");                                                                                                                                                             
END:                                                                                                                                                                             
    return EXIT_SUCCESS;                                                                                                                                                         
}

Measured memory_bytes: 3324