let f (s:string) = s.Split ' ' |> Seq.map int let uniqCount = Seq.distinct >> Seq.length let isValid0 n s = n = (s |> f |> uniqCount) let isValid1 s = let cache = s |> (f >> Seq.sort >> Seq.cache) 1 = (Seq.zip cache (Seq.skip 1 cache) |> Seq.map (fun e -> (snd e) - (fst e)) |> uniqCount) let isValid n s = (isValid0 n s) && (isValid1 s) if isValid (stdin.ReadLine () |> int) (stdin.ReadLine ()) then "YES" else "NO" |> printfn "%s"