#include using namespace std; #define ll long long static const long long MOD = 1000000007; static const int MAXN = 1000000; // adjust as ll inf = 1e17; ll f(ll x, ll num) { if (num > x) return x + 1; else if (num == x) return x; else return x- 1; } ll power(ll base, ll exp) { ll res = 1; base %= MOD; while (exp > 0) { if (exp % 2 == 1) res = (res * base) % MOD; base = (base * base) % MOD; exp /= 2; } return res; } void solve() { ll n; cin >> n; vectorarr(n); for (ll i = 0; i< n; i++) { cin >> arr[i]; } ll sum = arr[0] + arr[n - 1]; ll i = 0; ll j = n - 1; while (i < j) { ll num = arr[i] + arr[j]; if (num != sum) { cout << "No" << endl; return; } i++; j--; } cout << "Yes" << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); // int t; // cin >> t; // while (t--) // { // solve(); // } solve(); return 0; }