#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 2000005;
map<int, int> mp;
int n, m, m1, m2, t;
int G[N], tot;
int B[N][2], f[N][2], a[N], b[N], q[N], r;
int A[N], ans;
struct node {
  int x, y;
} Ans[N];
inline void work(int x, int y) {
  if (!x) {
    if (y == 1) A[++A[0]] = x, work(x, 0);
    return;
  }
  if (f[x - 1][y] == -1) {
    A[++A[0]] = x;
    work(x, y ^ 1);
    return;
  }
  if (!B[x][y]) {
    if (f[x][y] == f[x - 1][y] + G[x] - G[x - 1])
      work(x - 1, y);
    else
      A[++A[0]] = x, work(x, y ^ 1);
    return;
  }
  if (f[x - 1][y] + G[x] - G[x - 1] - 1 >= t &&
      f[x][y] == f[x - 1][y] - t + G[x] - G[x - 1]) {
    Ans[++ans] = (node){G[x - 1] + t - f[x - 1][y], y + 1};
    work(x - 1, y);
  } else
    A[++A[0]] = x, work(x, y ^ 1);
  return;
}
signed main() {
  n = read();
  m1 = read();
  m2 = read();
  t = read();
  for (int i = 1; i <= m1; ++i) {
    a[i] = read();
    q[++r] = a[i];
    q[++r] = a[i] + 1;
  }
  for (int i = 1; i <= m2; ++i) {
    b[i] = read();
    q[++r] = b[i];
    q[++r] = b[i] + 1;
  }
  sort(q + 1, q + r + 1);
  G[tot = 1] = 0;
  mp[0] = tot;
  for (int i = 1; i <= r; ++i)
    if (q[i] != q[i - 1]) G[++tot] = q[i], mp[q[i]] = tot;
  for (int i = 1; i <= m1; ++i) B[mp[a[i]]][0] = 1;
  for (int i = 1; i <= m2; ++i) B[mp[b[i]]][1] = 1;
  for (int i = 1; i <= tot; ++i) f[i][0] = f[i][1] = -1;
  f[1][0] = f[1][1] = 0;
  for (int i = 2; i <= tot; ++i) {
    if (f[i - 1][0] != -1) {
      if (B[i][0]) {
        if (f[i - 1][0] + G[i] - G[i - 1] - 1 >= t)
          f[i][0] = f[i - 1][0] - t + G[i] - G[i - 1];
      } else
        f[i][0] = f[i - 1][0] + G[i] - G[i - 1];
    }
    if (f[i - 1][1] != -1) {
      if (B[i][1]) {
        if (f[i - 1][1] + G[i] - G[i - 1] - 1 >= t)
          f[i][1] = f[i - 1][1] - t + G[i] - G[i - 1];
      } else
        f[i][1] = f[i - 1][1] + G[i] - G[i - 1];
    }
    if (!B[i][0]) f[i][0] = max(f[i][0], min(t, f[i][1]));
    if (!B[i][1]) f[i][1] = max(f[i][1], min(t, f[i][0]));
  }
  if (f[tot][0] == -1) {
    puts("No");
    return 0;
  }
  puts("Yes");
  if (f[tot][0] != -1) work(tot, 0);
  printf("%d\n", A[0]);
  for (int i = A[0]; i; --i) printf("%d ", G[A[i]]);
  puts("");
  printf("%d\n", ans);
  for (int i = ans; i; --i) printf("%d %d\n", Ans[i].x, Ans[i].y);
  return 0;
}
