import java.util.*;
import java.util.PriorityQueue;

class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    boolean flag=true;
    PriorityQueue in=new PriorityQueue();
    for(int x=0; x<num; x++){
      int input=scan.nextInt();
      in.offer(input);
    }
    int before=(int)in.poll();
    int after;
    for(int x=1; x<num; x++){
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    }
    if(flag){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
} import java.util.*; util.* java import java.util.PriorityQueue; PriorityQueue java.util class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    boolean flag=true;
    PriorityQueue in=new PriorityQueue();
    for(int x=0; x<num; x++){
      int input=scan.nextInt();
      in.offer(input);
    }
    int before=(int)in.poll();
    int after;
    for(int x=1; x<num; x++){
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    }
    if(flag){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
} Main public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    boolean flag=true;
    PriorityQueue in=new PriorityQueue();
    for(int x=0; x<num; x++){
      int input=scan.nextInt();
      in.offer(input);
    }
    int before=(int)in.poll();
    int after;
    for(int x=1; x<num; x++){
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    }
    if(flag){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  } main {
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    boolean flag=true;
    PriorityQueue in=new PriorityQueue();
    for(int x=0; x<num; x++){
      int input=scan.nextInt();
      in.offer(input);
    }
    int before=(int)in.poll();
    int after;
    for(int x=1; x<num; x++){
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    }
    if(flag){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int num=scan.nextInt(); num scan.nextInt() scan.nextInt scan boolean flag=true; flag true PriorityQueue in=new PriorityQueue(); in new PriorityQueue() for(int x=0; x<num; x++){
      int input=scan.nextInt();
      in.offer(input);
    } int x=0; int x=0; x 0 x<num x num x++ x++ x {
      int input=scan.nextInt();
      in.offer(input);
    } {
      int input=scan.nextInt();
      in.offer(input);
    } int input=scan.nextInt(); input scan.nextInt() scan.nextInt scan in.offer(input) in.offer in input int before=(int)in.poll(); before (int)in.poll() in.poll in int after; after for(int x=1; x<num; x++){
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    } int x=1; int x=1; x 1 x<num x num x++ x++ x {
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    } {
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    } after=(int)in.poll() after (int)in.poll() in.poll in if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      } before==after before after {
        flag=false;
        break;
      } flag=false flag false break; {
        before=after;
      } before=after before after if(flag){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    } flag {
      System.out.println("YES");
    } System.out.println("YES") System.out.println System.out System System.out "YES" {
      System.out.println("NO");
    } System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args
import java.util.*;
import java.util.PriorityQueue;

class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    boolean flag=true;
    PriorityQueue in=new PriorityQueue();
    for(int x=0; x<num; x++){
      int input=scan.nextInt();
      in.offer(input);
    }
    int before=(int)in.poll();
    int after;
    for(int x=1; x<num; x++){
      after=(int)in.poll();
      if(before==after){
        flag=false;
        break;
      }else{
        before=after;
      }
    }
    if(flag){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
}