defmodule Main do def main do IO.read(:line) IO.read(:line) |> String.split() |> Enum.map(&String.to_integer/1) |> solve |> IO.puts() end def solve(x) do d = x |> Enum.sort() |> each_cons_2 |> Enum.map(fn {a, b} -> b - a end) cond do d |> Enum.uniq() |> length <= 1 && d |> hd != 0 -> "YES" true -> "NO" end end def each_cons_2(l) do [l |> Enum.slice(0..-2), l |> Enum.slice(1..-1)] |> Enum.zip() end end