#include using namespace std; // type aliases using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair; using pll = pair; using vi = vector; using vll = vector; using vvi = vector>; using vvll = vector>; using vb = vector; using vvb = vector>; using vs = vector; using vpii = vector>; using vpll = vector>; using mi = map; using mll = map; using umi = unordered_map; using umll = unordered_map; using si = set; using sll = set; using usi = unordered_set; using usll = unordered_set; using qi = queue; using qll = queue; using di = deque; using dll = deque; using li = list; using dllist = list; using sti = stack; using stll = stack; // macros #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) ((int)(x).size()) #define fi first #define se second #define endl '\n' #define fastio ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #define debug(x) cerr << #x << " = " << (x) << endl #define forf(i, a, b) for (int i = (a); i < (b); ++i) #define forr(i, a, b) for (int i = (a); i >= (b); --i) #define forc(i, a, b, c) for (int i = (a); i < (b); i += (c)) #define fora(i, x) for (auto& i : (x)) #define forar(i, x) for (auto& i : (x)) // constants const int INF = numeric_limits::max(); const long long LINF = numeric_limits::max(); const double EPS = 1e-9; const double PI = acos(-1); const int MOD = 1e9 + 7; // utility functions template T gcd(T a, T b){ while(b){ T temp = b; b = a%b; a =temp; } return a; } template T lcm(T a, T b){ return (a / gcd(a, b)) * b; } template T mod_pow(T base, T exp, T mod){ T result = 1; base%= mod; while(exp > 0){ if(exp & 1) result= (result * base) % mod; base= (base * base) % mod; exp>>= 1; } return result; } template T mod_inv(T a, T mod){ return mod_pow(a, mod - 2, mod); } template T mod_add(T a, T b, T mod){ return ((a % mod) + (b % mod)) % mod; } template T mod_sub(T a, T b, T mod){ return ((a % mod) - (b % mod) + mod) % mod; } template T mod_mul(T a, T b, T mod){ return ((a % mod) * (b % mod)) % mod; } template T mod_div(T a, T b, T mod){ return mod_mul(a, mod_inv(b, mod), mod); } template T seive(T n){ vector is_prime(n + 1, true); is_prime[0] = is_prime[1] = false; for(T i = 2; i * i <= n; ++i){ if(is_prime[i]){ for(T j = i * i; j <= n; j += i){ is_prime[j] = false; } } } return is_prime; } template vector prime_factors(T n){ vector factors; for(T i = 2; i * i <= n; ++i){ while(n % i == 0){ factors.push_back(i); n /= i; } } if(n > 1){ factors.push_back(n); } return factors; } template vector divisors(T n){ vector divs; for(T i = 1; i * i <= n; ++i){ if(n % i == 0){ divs.push_back(i); if(i != n / i){ divs.push_back(n / i); } } } return divs; } template T combinatorics(T n, T r, T mod){ if(r > n) return 0; if(r == 0 || r == n) return 1; vector fact(n + 1, 1); for(T i = 2; i <= n; ++i){ fact[i] = mod_mul(fact[i - 1], i, mod); } return mod_div(fact[n], mod_mul(fact[r], fact[n - r], mod), mod); } int main(){ fastio #ifdef TESTING freopen("input.txt", "r", stdin); #endif int n; cin>>n; vi vec(n); for(int &i: vec) cin>>i; int sum= vec[0]+vec[n-1]; for(int i=0;i<=n/2;i++){ if(vec[i]+vec[n-1-i]!=sum){ cout<<"NO"<