#include <bits/stdc++.h>
const int N = 4444444;
const int M = 100000007;
const int INF = 1000000099;
long long Pw(long long a, long long b, long long p) {
  long long v = 1;
  for (; b; b >>= 1, a = a * a % p)
    if (b & 1) v = v * a % p;
  return v;
}
using namespace std;
vector<int> Q;
vector<pair<int, int> > P;
int n, L, m1, m2, T, t, _t, x, y, v1[N], v2[N], v[N], V[N], f[N][2], e[N][2];
int main() {
  scanf("%d", &L);
  scanf("%d", &m1);
  scanf("%d", &m2);
  scanf("%d", &T);
  for (int i = 1; i <= m1; i++) scanf("%d", &v1[i]), v[++t] = v1[i];
  for (int i = 1; i <= m2; i++) scanf("%d", &v2[i]), v[++t] = v2[i];
  v[++t] = L + 1;
  sort(v + 1, v + t + 1);
  _t = t;
  for (int i = 1; i <= t; i++)
    if (v[i - 1] + 1 < v[i]) v[++_t] = v[i - 1] + 1;
  t = _t;
  sort(v + 1, v + t + 1);
  n = unique(v + 1, v + t + 1) - v - 1;
  for (int i = 1; i <= m1; i++)
    V[lower_bound(v + 1, v + n + 1, v1[i]) - v] |= 1;
  for (int i = 1; i <= m2; i++)
    V[lower_bound(v + 1, v + n + 1, v2[i]) - v] |= 2;
  f[0][0] = f[0][1] = T;
  e[0][1] = 2;
  for (int i = 1; i <= n; i++) {
    f[i][0] = f[i][1] = INF;
    if (V[i] & 1) {
      if (f[i - 1][0] < v[i]) f[i][0] = f[i - 1][0] + T, e[i][0] = 1;
    } else
      f[i][0] = f[i - 1][0];
    if (V[i] & 2) {
      if (f[i - 1][1] < v[i]) f[i][1] = f[i - 1][1] + T, e[i][1] = 1;
    } else
      f[i][1] = f[i - 1][1];
    x = max(f[i][1], v[i]);
    if (!(V[i] & 1) && f[i][0] > x) f[i][0] = x, e[i][0] = 2;
    x = max(f[i][0], v[i]);
    if (!(V[i] & 2) && f[i][1] > x) f[i][1] = x, e[i][1] = 2;
  }
  if (f[n][0] == INF && f[n][1] == INF) return puts("No"), 0;
  puts("Yes");
  x = n;
  y = (f[n][0] < INF ? 0 : 1);
  for (; x || y;) {
    if (e[x][y] == 1) {
      P.push_back(make_pair(f[x][y] - T, y + 1));
    }
    if (e[x][y] == 2) {
      y ^= 1;
      Q.push_back(v[x]);
      continue;
    }
    x--;
  }
  printf("%d\n", Q.size());
  for (int i = Q.size() - 1; ~i; i--) printf("%d%c", Q[i], i == 0 ? '\n' : ' ');
  printf("%d\n", P.size());
  for (int i = P.size() - 1; ~i; i--)
    printf("%d %d\n", P[i].first, P[i].second);
}
