#include <bits/stdc++.h>

using namespace std;
using ll=long long;
using ld=long double;
using ull=unsigned long long;
using lll=__int128;

#ifdef LOCAL
#define deb(x) cout<<__LINE__<<": "<<(#x)<<" = "<<(x)<<endl;
#else
#define deb(x)
#endif
#define all(x) x.begin(), x.end()
#define arr(x) x.rbegin(), x.rend()
#define int ll

signed main(){
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    int n,m;
    cin>>n>>m;
    vector<int> a(n);
    for (auto i=0; i<n; ++i) cin>>a[i];
    for (auto i=0; i<n; ++i) {
        if ((a[i]+a[0])%2) {
            cout<<"No";
            exit(0);
        }
    }
    if (t==1) {
        cout<<"Yes";
        exit(0);
    }
}
