using System; public class Hello { public static void Main() { var n = int.Parse(Console.ReadLine().Trim()); string[] line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); Array.Sort(a); var t = a[1] - a[0]; if (t == 0) { Console.WriteLine("NO"); goto end; } for (int i = 1; i < n-1; i++) if (a[i + 1] - a[i] != t) { Console.WriteLine("NO"); goto end; } Console.WriteLine("YES"); end:; } }