#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll mod=1000000007; ll inf=1009999999999999990; int main(){ ll n; cin >> n; vectora(n); ll sum=0; ll mx=0; for (ll i = 0; i < n; i++) { cin >> a[i]; sum+=a[i]; } if (sum%n==0) { if (n%2==0) { for (ll i = 1; i < n; i++) { if (a[i]%2!=a[i-1]%2) { cout << "No" << endl; return 0; } } } cout << "Yes" << endl; }else{ cout << "No" <