let n = stdin.ReadLine() |> int let a = stdin.ReadLine().Split() |> Array.map int let revA = Array.rev a let x = a.[0] + revA.[0] let mutable flg = true for i = 0 to n - 1 do if a.[i] + revA.[i] <> x then flg <- false if flg then "Yes" else "No" |> printfn "%s"