#include <bits/stdc++.h>
#define int ll

using namespace std;
using ll = long long;
using ld = double;

struct ST {
    vector<int> tree;
    vector<int> a;
    void build(int v, int l, int r) {
        if (l + 1 == r) {
            tree[v] = a[l];
            return;
        }
        int m = (l + r) / 2;
        build(v * 2 + 1, l, m);
        build(v * 2 + 2, m, r);
        tree[v] = min(tree[v * 2 + 1], tree[v * 2 + 2]);
    }

    int get(int v, int l, int r, int ql, int qr) {
        if (qr <= l || r <= ql) {
            return (int)2e9;
        }
        if (ql <= l && r <= qr) {
            return tree[v];
        }
        int m = (l + r) / 2;
        return min(get(v * 2 + 1, l, m, ql, qr), get(v * 2 + 2, m, r, ql, qr));
    }
};

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]--;
    }
    int cur = a[0] % 2;
    for (int i = 0; i < n; i++) {
        if (a[i] % 2 != cur) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
    return 0;
}