let solve x = let n = Array.length x let mutable mn = 1000000000 let mutable mx = -1000000000 for i in 0 .. n - 2 do mn <- min mn (x.[i + 1] - x.[i]) mx <- max mx (x.[i + 1] - x.[i]) if mn = mx && mx <> 0 then "YES" else "NO" let n = System.Console.ReadLine() |> int let x = System.Console.ReadLine().Split() |> Array.map int |> Array.sort System.Console.WriteLine(solve x)