using System; using System.Collections; using System.Linq; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); //数字1つを読み込み int[] xs = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); Array.Sort(xs); int sa = xs[1] - xs[0]; bool check = true; for (int i = 1; i < n; i++) { if (sa != xs[i] - xs[i - 1]) { check = false; break; } } if (sa == 0) { check = false; } if (check) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } }