func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     unsigned long long a[n], M;     for (int i = 0; i < n; ++i) {       cin >> a[i];     }     stack<unsigned long long> s;     M = *max_element(a, a + n);     for (int i = 0; i < n; ++i) {       a[i] = (M - a[i]) % 2;       if (s.empty() || s.top() != a[i])         s.push(a[i]);       else         s.pop();     }     bool ans2 = false;     for (int i = 0; i < n - 1 && !ans2; ++i) {       ans2 = ans2 || (a[i] == a[i + 1]);     }     bool all1 = true, all0 = true;     while (!s.empty()) {       all0 = all0 && (s.top() == 0);       all1 = all1 && (s.top() == 1);       s.pop();     }     bool ans = all0 || all1;     cout << (ans ?  YES  :  NO ) << endl;     return 0;   }   