#include <bits/stdc++.h>
using namespace std;

#define int long long
#define pb push_back
#define endl "\n"
using ll = long long;
using pii = pair<int, int>;
using ld = long double;

template <typename t>
istream& operator>>(istream &in, vector<t> &a){
    for (auto &el : a){
        in >> el;
    }
    return in;
}

template <typename t>
ostream& operator<<(ostream &out, vector<t> &a){
    for (auto &el : a){
        out << el << " ";
    }
    return out;
}



void solve(){
    int t;
    cin >> t;
    int n;
    cin >> n;
    int m;
    cin >> m;
    vector<int> a(n);
    int now = 0;
    for (int i = 0; i < n; ++i){
        cin >> a[i];
        if (i == 0) now = a[i] % 2;
        if (now != a[i] % 2){
            cout << "No" << endl;
        }
    }
    cout << "Yes" << endl;
}



signed main(){
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}   