import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; 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; Set set = new HashSet<>(); for (int i = 0; i < n; i++) { if (a[i] == 0) { z++; } else { if (i > 0 && a[i - 1] > 0) { set.add(a[i] - a[i - 1]); mind = Math.min(mind, a[i] - a[i - 1]); } } } for (long e : set) { mind = gcd(mind, e); } if (judge(n, a, z, mind)) { System.out.println("Yes"); } else { System.out.println("No"); } } static long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); } 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 (mind == 0) { if (d > 0) { return false; } } else if (d % mind != 0 || d == 0) { return false; } else { z -= d / mind - 1; if (z < 0) { return false; } } } return true; } }