#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cassert>
#include <ctime>
#include <random>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

// #pragma GCC optimize("Ofast")
// #pragma ivdep

using namespace std;
using ll = long long;
using ld = long double;
using lll = __int128;
using pii = pair<int, int>;
// using namespace __gnu_pbds;
// template<class T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

void solve() {
    int t; cin >> t;
    int n, m; cin >> n >> m;
    int ts = 0;
    for (int i = 0; i < n; ++i) {
        int a; cin >> a;
        if (i != 0 && a % 2 != ts) {
            cout << "No\n";
            return;
        }
        ts = a % 2;
    }
    cout << "Yes\n";
}

int main() {
    cin.tie(0)->sync_with_stdio(0);

    int _ = 1;
    #ifdef DEBUG
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        cin >> _;
    #endif

    while (_--) {
        solve();
        cout << '\n';
    }

    return 0;
}
