#include <bits/stdc++.h>
using namespace std;
int IN() {
  int c, f, x;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  c == '-' ? (f = 1, x = 0) : (f = 0, x = c - '0');
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + c - '0';
  return !f ? x : -x;
}
const int N = 4e6 + 19;
const int oo = (1 << 30) - 1;
map<pair<int, int>, int> M;
int dp[2][N], pre[2][N], A[2][N];
int x[N], x1[N], x2[N];
int n, m1, m2, t, m, w, las;
void upd(int i, int j, int y, int z) {
  if (y > dp[i][j]) {
    dp[i][j] = y;
    pre[i][j] = z;
  }
}
int main() {
  n = IN();
  m1 = IN(), m2 = IN(), t = IN();
  for (int i = 1; i < m1 + 1; i++) {
    x1[i] = IN();
    M[make_pair(0, x1[i])] = 1;
    x[++m] = x1[i];
    x[++m] = x1[i] + 1;
  }
  for (int i = 1; i < m2 + 1; i++) {
    x2[i] = IN();
    M[make_pair(1, x2[i])] = 1;
    x[++m] = x2[i];
    x[++m] = x2[i] + 1;
  }
  x[++m] = 1;
  x[++m] = n + 1;
  sort(x + 1, x + m + 1);
  m = unique(x + 1, x + m + 1) - x - 1;
  for (int i = 1; i < m1 + 1; i++) {
    A[0][lower_bound(x, x + m + 1, x1[i]) - x] = 1;
  }
  for (int i = 1; i < m2 + 1; i++) {
    A[1][lower_bound(x, x + m + 1, x2[i]) - x] = 1;
  }
  memset(dp, -1, sizeof(dp));
  dp[0][0] = dp[1][0] = 0;
  pre[1][0] = 1;
  for (int i = 0; i < m; i++) {
    for (int w = 0; w < 2; w++)
      if (~dp[w][i] && !A[w ^ 1][i]) upd(w ^ 1, i, min(dp[w][i], t), 1);
    for (int w = 0; w < 2; w++)
      if (~dp[w][i] && dp[w][i] + x[i + 1] - x[i] - 1 >= t * A[w][i + 1]) {
        upd(w, i + 1, dp[w][i] + x[i + 1] - x[i] - t * A[w][i + 1], 0);
      }
  }
  w = (dp[0][m] > dp[1][m] ? 0 : 1);
  if (dp[w][m] == -1) {
    puts("No");
  } else {
    puts("Yes");
    vector<int> A;
    vector<pair<int, int> > B;
    las = oo;
    for (int i = w, j = m; i || j;) {
      if (pre[i][j]) {
        A.push_back(x[j]), i ^= 1;
      } else {
        if (::A[i][j]) {
          las = min(las - t, x[j] - 1);
          B.push_back(make_pair(las, i + 1));
        }
        j--;
      }
    }
    printf("%d\n", A.size());
    for (int i = int(A.size()) - 1; ~i; i--) printf("%d ", A[i]);
    puts("");
    printf("%d\n", B.size());
    for (int i = int(B.size()) - 1; ~i; i--)
      printf("%d %d\n", B[i].first, B[i].second);
  }
}
