package main import . "fmt" func main() { var n int Scan(&n) a := make([]int, n) for i := range a { Scan(&a[i]) } for i := 0; i < n; i++ { if a[i]+a[n-1-i] != a[0]+a[n-1] { Println("No") return } } Println("Yes") }