#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <experimental/random>

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

const ll INF = 3e18, MOD = 998244353;

void solve();

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int q = 1;
    // cin >> q;
    while (q--) {
        solve();
    }
}

void solve() {
    ll T, n, m;
    cin >> T >> n >> m;
    bool f1 = false, f2 = false;
    for (int i = 0; i < n; i++) {
        ll x; cin >> x;
        if (x % 2 == 0) {
            f1 = true;
        } else {
            f2 = true;
        }
    }
    string s;
    cin >> s;
    if (f1 && f2) {
        cout << "No";
    } else {
        cout << "Yes";
    }
}
