#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 1000000 + 2;
int len, n1, n2, treload;
int x1[MAXN], x2[MAXN];
int x[MAXN], nx;
bool blocked[MAXN][2];
int dp[MAXN][2];
int pi[MAXN][2];
int pj[MAXN][2];
int pkind[MAXN][2];
int pshoot[MAXN][2];
int changes[2 * MAXN], nchanges;
pair<int, int> shots[2 * MAXN];
int nshots;
void upd(int ni, int nj, int i, int j, int val, int kind, int shoot) {
  if (val >= dp[ni][nj]) return;
  dp[ni][nj] = val, pi[ni][nj] = i, pj[ni][nj] = j, pkind[ni][nj] = kind,
  pshoot[ni][nj] = shoot;
}
void run() {
  scanf("%d%d%d%d", &len, &n1, &n2, &treload);
  for (int i = (0); i < (n1); ++i) scanf("%d", &x1[i]);
  for (int i = (0); i < (n2); ++i) scanf("%d", &x2[i]);
  nx = 0;
  for (int i = (0); i < (n1); ++i) x[nx++] = x1[i];
  for (int i = (0); i < (n2); ++i) x[nx++] = x2[i];
  x[nx++] = 0;
  x[nx++] = len + 1;
  sort(x, x + nx);
  nx = unique(x, x + nx) - x;
  for (int i = (0); i < (nx); ++i) blocked[i][0] = blocked[i][1] = false;
  for (int i = (0); i < (n1); ++i) {
    int idx = lower_bound(x, x + nx, x1[i]) - x;
    blocked[idx][0] = true;
  }
  for (int i = (0); i < (n2); ++i) {
    int idx = lower_bound(x, x + nx, x2[i]) - x;
    blocked[idx][1] = true;
  }
  for (int i = (0); i < (nx); ++i) dp[i][0] = dp[i][1] = INT_MAX;
  dp[0][0] = dp[0][1] = treload;
  for (int i = (0); i < (nx - 1); ++i) {
    for (int j = (0); j < (2); ++j)
      if (dp[i][j] != INT_MAX) {
        {
          int val = dp[i][j];
          if (!blocked[i + 1][j]) {
            upd(i + 1, j, i, j, val, 0, -1);
          } else if (dp[i][j] < x[i + 1]) {
            upd(i + 1, j, i, j, val + treload, 0, val);
          }
        }
        bool candirect = !blocked[i][1 - j];
        if (x[i] + 1 < x[i + 1] || candirect) {
          int val = max(dp[i][j], x[i] + (!candirect ? 1 : 0));
          if (!blocked[i + 1][1 - j]) {
            upd(i + 1, 1 - j, i, j, val, candirect ? 1 : 2, -1);
          } else if (val < x[i + 1]) {
            upd(i + 1, 1 - j, i, j, val + treload, candirect ? 1 : 2, val);
          }
        }
      }
  }
  int ti = nx - 1, tj = -1;
  for (int j = (0); j < (2); ++j)
    if (dp[ti][j] != INT_MAX) {
      tj = j;
      break;
    }
  if (tj == -1) {
    printf("No\n");
    return;
  }
  printf("Yes\n");
  nchanges = 0, nshots = 0;
  {
    int i = ti, j = tj;
    while (true) {
      if (i == 0) {
        if (j == 1) changes[nchanges++] = x[i];
        break;
      }
      int ii = pi[i][j], jj = pj[i][j], kind = pkind[i][j],
          shoot = pshoot[i][j];
      if (shoot != -1) shots[nshots++] = make_pair(shoot, j + 1);
      i = ii, j = jj;
      if (kind == 1) changes[nchanges++] = x[i];
      if (kind == 2) changes[nchanges++] = x[i] + 1;
    }
    reverse(changes, changes + nchanges);
    reverse(shots, shots + nshots);
    printf("%d\n", nchanges);
    for (int i = (0); i < (nchanges); ++i) {
      if (i != 0) printf(" ");
      printf("%d", changes[i]);
    }
    puts("");
    printf("%d\n", nshots);
    for (int i = (0); i < (nshots); ++i)
      printf("%d %d\n", shots[i].first, shots[i].second);
  }
}
int main() {
  run();
  return 0;
}
