#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define all(v) begin(v), end(v)
#define rall(v) rbegin(v), rend(v)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ROF(i, a, b) for(ll i = b; i >= a; --i)

mt19937 rnd(42);
mt19937_64 rnd64(52);

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ll T, n, m;
    cin >> T >> n >> m;
    vector<ll> a(n);
    for (ll i = 0; i < n; ++i) {
        cin >> a[i];
    }
    ll cnt0 = 0, cnt1 = 0;
    for (ll i= 0; i < n; ++i) {
        if (a[i] % 2 == 0) cnt0++;
        else cnt1++;
    }
    if (cnt0 > 0 && cnt1 > 0) {
        cout << "No";
    }
    else {
        cout << "Yes";
    }
}