import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextLong(); } sc.close(); Arrays.sort(a); long z = 0; long mind = 1000000000000000000L; for (int i = 0; i < n; i++) { if (a[i] == 0) { z++; } else { if (i > 0) { mind = Math.min(mind, a[i] - a[i - 1]); } } } if (mind == 0) { System.out.println("Yes"); return; } for (int i = 1; i <= n; i++) { if (mind % i == 0 && judge(n, a, z, mind / i)) { System.out.println("Yes"); return; } } System.out.println("No"); } static boolean judge(int n, long[] a, long z, long mind) { for (int i = (int) z + 1; i < n; i++) { long d = a[i] - a[i - 1]; if (d % mind != 0) { return false; } else { z -= d / mind - 1; if (z < 0) { return false; } } } return true; } }