#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
using namespace std;
const int OO = 1e9;
const long long INF = 1e18;
const int irand(int lo, int hi) {
  return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
const long long lrand(long long lo, long long hi) {
  return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
template <typename T>
T getnum() {
  int sign = 1;
  T ret = 0;
  char c;
  do {
    c = getchar();
  } while (c == ' ' || c == '\n');
  if (c == '-')
    sign = -1;
  else
    ret = c - '0';
  while (1) {
    c = getchar();
    if (c < '0' || c > '9') break;
    ret = 10 * ret + c - '0';
  }
  return sign * ret;
}
inline void ini(int& x) { x = getnum<int>(); }
inline void scani(int& x) { scanf("%d", &x); }
const int N = 1e6 + 5;
int n, m1, m2, t;
int arr1[N];
int arr2[N];
map<int, int> mep;
vector<int> revex;
vector<int> dist;
bool obs[2][3 * N];
int dp[2][3 * N];
int shoot[2][3 * N];
stack<int> swt;
stack<pair<int, int> > shots;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m1 >> m2 >> t;
  for (int i = 1; i <= m1; i += 1) cin >> arr1[i];
  for (int i = 1; i <= m2; i += 1) cin >> arr2[i];
  mep[0] = 0;
  mep[n + 1] = 0;
  for (int i = 1; i <= m1; i += 1) {
    mep[arr1[i]] = 0;
    mep[arr1[i] - 1] = 0;
    mep[arr1[i] + 1] = 0;
  }
  for (int i = 1; i <= m2; i += 1) {
    mep[arr2[i]] = 0;
    mep[arr2[i] - 1] = 0;
    mep[arr2[i] + 1] = 0;
  }
  int id = -1;
  int prev = -1;
  for (map<int, int>::iterator it = mep.begin(); it != mep.end(); it++) {
    if (prev == -1) {
      dist.push_back(0);
    } else {
      dist.push_back(it->first - prev);
    }
    prev = it->first;
    it->second = ++id;
    revex.push_back(it->first);
  }
  for (int i = 1; i <= m1; i += 1) obs[0][mep[arr1[i]]] = true;
  for (int i = 1; i <= m2; i += 1) obs[1][mep[arr2[i]]] = true;
  dp[0][0] = 0;
  dp[1][0] = 0;
  shoot[1][0] = -1;
  for (int i = 1; i <= id; i += 1) {
    for (int j = 0; j <= 1; j += 1) {
      if (dp[j][i - 1] == -1)
        dp[j][i] = -1;
      else
        dp[j][i] = dp[j][i - 1] + dist[i];
      if (obs[j][i]) {
        if (dp[j][i] > t) {
          dp[j][i] -= t;
          shoot[j][i] = revex[i] - dp[j][i];
        } else {
          dp[j][i] = -1;
        }
      }
    }
    for (int j = 0; j <= 1; j += 1) {
      if (!obs[j][i]) {
        int tmp = min(dp[j ^ 1][i], t);
        if (tmp > dp[j][i]) {
          dp[j][i] = tmp;
          shoot[j][i] = -1;
        }
      }
    }
  }
  if (dp[0][id] == -1) {
    cout << "No" << '\n';
  } else {
    cout << "Yes" << '\n';
    int i = id;
    int j = 0;
    while (1) {
      if (shoot[j][i] == -1) {
        swt.push(revex[i]);
        j = j ^ 1;
      }
      if (i == 0 && j == 0) break;
      if (shoot[j][i] > 0) {
        shots.push(make_pair(shoot[j][i], j + 1));
      }
      i--;
    }
    cout << swt.size() << '\n';
    while (!swt.empty()) {
      cout << swt.top() << " ";
      swt.pop();
    }
    cout << '\n';
    cout << shots.size() << '\n';
    while (!shots.empty()) {
      cout << shots.top().first << " " << shots.top().second << '\n';
      shots.pop();
    }
  }
  return 0;
}
