import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int []x = new int[N]; for(int i = 0; i < N; i++) { x[i] = scan.nextInt(); } scan.close(); Arrays.sort(x); int k = x[1] - x[0]; if(k == 0) { System.out.println("NO"); System.exit(0); } for(int i = 1; i < N - 1; i++) { if(k != x[i+1] - x[i]) { System.out.println("NO"); System.exit(0); } } System.out.println("YES"); } }