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

using namespace std;

signed main() {
    int t, m;
    cin >> t;
    int n;
    cin >> n >> m;
    vector <int> arr(n);
    for (int i = 0; i < n; ++i) {
        cin >> arr[i];
        if (i != 0 && arr[i] % 2 != arr[i - 1] % 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    string s;
    cin >> s;
    cout << "Yes" << endl;
    return 0;
}
