open System type Sol() = member this.Solve() = let N = stdin.ReadLine() |> int let A = stdin.ReadLine().Split(' ') |> Array.map int |> Array.sort let pairA = Seq.pairwise A |> Seq.map (fun (x,y) -> (y - x)) |> Seq.distinct let yesno = ((Seq.distinct A |> Seq.length) = N) && (Seq.length pairA) = 1 if yesno = true then Console.WriteLine("YES") else Console.WriteLine("NO") let mySol = new Sol() mySol.Solve()