using System.Collections.Generic; using System; public class Hello { static void Main() { var n = int.Parse(Console.ReadLine().Trim()); string[] line = Console.ReadLine().Trim().Split(' '); var a = new List(); var z = 0; for (int i = 0; i < n; i++) { var t = long.Parse(line[i]); if (t == 0) z++; else a.Add(t); } getAns(n, z, a); } static bool checkD0(List a) { var pre = a[0]; foreach (var x in a) if (x != pre) return false; return true; } static void getAns(int n, int z, List a) { var acount = a.Count; if (acount <=2) { Console.WriteLine("Yes");return; } a.Sort(); var dlist = new List(); var g = a[1] - a[0]; if (g == 0) { Console.WriteLine(checkD0(a) ? "Yes" : "No"); return; } dlist.Add(g); for (int i = 2; i < acount; i++) { var tt = a[i] - a[i - 1]; if (tt == 0) { Console.WriteLine(checkD0(a) ? "Yes" : "No"); return; } g = Gcd(g, tt); dlist.Add(tt); } var ans = 0L; foreach (var x in dlist) ans += x / g - 1; Console.WriteLine(z >= ans ? "Yes" : "No"); } public static long Gcd(long a, long b) { if (a < b) return Gcd(b, a); while (b != 0) { var w = a % b; a = b; b = w; } return a; } }