#include <bits/stdc++.h>

using namespace std;

#define int long long
#define pb push_back
#define ff first
#define ss second

void solve() {
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    bool f = true;
    for (int i = 0; i < n - 1; i++) {
        if (abs(a[i] - a[i + 1]) % 2 == 1) f = false;
    }
    if (f) cout << "Yes";
    else cout << "No";
}

signed main() {
//    freopen("input.txt", "rb", stdin);
//    freopen("output.txt", "wb", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
//    cin >> t;
    while (t--) solve();
}
