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