#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/hash_policy.hpp>
#define int long long
#define pll pair <int, int>
#define f first
#define s second
#define all(A) A.begin(), A.end()
#define rall(A) A.rbegin(), A.rend()
#define oset ordered_set
#define omultiset ordered_multiset
#define skip continue
#pragma GCC target("avx2")
#pragma GCC optmize("O3")
#pragma GCC optmize("unroll-loops")

using namespace std;
using namespace __gnu_pbds;

template <typename T> using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T> using ordered_multiset = tree<T, null_type, less_equal<>, rb_tree_tag, tree_order_statistics_node_update>;

const int N = 5e5 + 5, MOD = 998244353;
int precalc[N], b[N], a[N];
map <pll, int> cnt_inter;
pll lr[N];

int bin_pow(int x, int n) {
    int res = 1;
    while (n) {
        if ((n & 1)) res = res * x % MOD;
        n >>= 1;
        x = x * x % MOD;
    }
    return res;
}

int scan() {
    int x; cin >> x;
    return x;
}

string read() {
    string s; cin >> s;
    return s;
}

int get_pos(int time, int m, int i, string &napravlenie) {
    time += a[i];
    int z = time / m + (napravlenie[i] == 'R' ? 0 : 1);
    return (z % 2 ? m - time % m : time % m + 1);
}

void SLAVA_MORDOVII() {
    int TYPE = scan();
    int n = scan(), m = scan();
    bool f = a[0] % 2;
    for (int i = 0; i < n; i++) {
        if (a[i] % 2 != f) {
            cout << "No\n"; return;
        }
    }
    cout << "Yes\n";
    //
    // for (int i = 0; i < n; i++) a[i] = scan();
    // string s = read();
    // int pos1 = a[0], pos2 = a[1];
    // int nap1 = 1 - 2 * (s[0] == 'L');
    // int nap2 = 1 - 2 * (s[1] == 'L');
    // for (int t = 0; t < 10 * m; t++) {
    //     if (pos1 == pos2) {
    //         cout << "Yes\n";
    //         if (TYPE == 2 || TYPE == 3) cout << pos1 << '\n';
    //         if (TYPE == 3) cout << "1\n" << time << ' ' << pos1 << '\n';
    //         return;
    //     }
    //     pos1 += nap1;
    //     if (pos1 == 0) {
    //         nap1 = 1; pos1 = 2;
    //     }
    //     if (pos1 == m + 1) {
    //         nap1 = -1, pos1 = m - 1;
    //     }
    //     pos2 += nap2;
    //     if (pos2 == 0) {
    //         nap2 = 1; pos2 = 2;
    //     }
    //     if (pos2 == m + 1) {
    //         nap2 = -1, pos2 = m - 1;
    //     }
    //     //cout << pos1 << ' ' << pos2 << '\n';
    // }
    // cout << "No\n";
}

int32_t main() {
    SLAVA_MORDOVII();
}