using System; using System.Linq; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(x); string ans = "YES"; int k = x[1] - x[0]; if (k == 0) { ans = "NO"; } else { for (int i = 1; i < n - 1; i++) { if (x[i + 1] - x[i] != k) { ans = "NO"; break; } } } Console.WriteLine(ans); } }