#include <bits/stdc++.h>
using namespace std;
#define int long long
const int inf = 1e18;
bool comp(pair<int, int> &p1, pair<int, int> &p2) {
    if (p1.first == p2.first) {
        return p1.second < p2.second;
    }
    return p1.first > p2.first;
}
signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int T;
    cin >> T;
    int n,m;
    cin >> n >> m;
    vector<int> a(n);
    set<int> curs;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        curs.insert(a[i] % 2);
    }
    string s;
    cin >> s;
    if (curs.size() == 1) {
        cout << "Yes\n";
    }else {
        cout << "No\n";
    }
}

