import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] l = new int[N]; for(int i = 0; i < N; i++) { l[i] = sc.nextInt(); } Arrays.sort(l); int tmp = l[1] - l[0]; boolean ok = true; for(int i = 1; i < N-1; i++) { if(tmp != l[i+1] - l[i]) { ok = false; break; } } if(tmp == 0) ok = false; System.out.println((ok?"YES":"NO")); } }