/* -*- coding: utf-8 -*- * * 3387.cc: No.3387 23578 Sequence - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 100; /* typedef */ /* global variables */ int as[MAX_N]; /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", as + i); int s = as[0] + as[n - 1]; bool ok = true; for (int i = 0, j = n - 1; ok && i <= j; i++, j--) ok = (as[i] + as[j] == s); if (ok) puts("Yes"); else puts("No"); return 0; }