#include <bits/stdc++.h>
// #pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
ll t, n, m, ans,a[200002], i, ti, k0, k1,j;
char c[200002];
set<ll>st;
vector<ll>v;
vector<pair<ll,ll>>out;
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> t >> n >> m;
    for (i = 1; i <= n; i++) {
        cin >> a[i];
        st.insert(a[i]);
        if (a[i] % 2) {
            k1++;
        } else {
            k0++;
        }
    }
    for (i = 1; i <= n; i++) {
        cin >> c[i];
    }
    if (k0 && k1) {
        cout << "No";
        return 0;
    }
    cout << "Yes\n";
    if (t==1) {
        return 0;
    }
    for (auto x:st) {
        v.push_back(x);
    }
    for (i=v.size()-2;i>=0;i--) {
        out.push_back({m-(v[v.size()-1]+v[i])/2, m+(v[i]-v[v.size()-1])/2});
    }
    cout << out.back().second << endl;
    if (t==2) {
        return 0;
    }
    cout << out.size() << endl;
    for (auto x: out) {
        cout << x.first << ' ' << x.second << endl;
    }
    return 0;
}
