using ll = long long;
using namespace std;
#include <iostream>
#include <vector>
#include <algorithm>
#define all(x) (x).begin(), (x).end()
#pragma GCC optimize("O3")
int main() {
    if (1) {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }
    ll n, m, g;
    cin >> g >> n >> m;
    vector <ll> a(n);
    for (ll i = 0; i < n; ++i)
        cin >> a[i];
    string dir;
    cin >> dir;
    ll mask = 0;
    for (ll i = 0; i < n; ++i) {
        mask |= (1 << (a[i] % 2));
    }
    if (mask == 3) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    if (g == 1) {
        return 0;
    }
}
