#include <bits/stdc++.h>
using std::cerr;
using std::endl;
const int N = 3e6 + 233;
int n, m[2], t, pos[2][N], key[N], tot;
bool ban[2][N];
int f[N][2];
std::pair<int, int> g[N][2];
std::vector<int> ans1;
std::vector<std::pair<int, int>> ans2;
void dfs(int x, int y) {
  if (!x && !y) return;
  int px = g[x][y].first, py = g[x][y].second;
  if (px == x) {
    ans1.emplace_back(key[x]);
  }
  if (ban[y][x]) {
    int sx = key[x] - f[x][y], sy = y;
    ans2.emplace_back(std::make_pair(sx, sy + 1));
  }
  dfs(px, py);
}
int main() {
  scanf("%d%d%d%d", &n, m + 0, m + 1, &t);
  for (int j = 0; j < 2; ++j)
    for (int i = 1; i <= m[j]; ++i) {
      scanf("%d", pos[j] + i);
      key[++tot] = pos[j][i];
      key[++tot] = pos[j][i] + 1;
    }
  key[++tot] = n, key[++tot] = n + 1;
  std::sort(key + 1, key + tot + 1);
  tot = std::unique(key + 1, key + tot + 1) - key - 1;
  for (int j = 0; j < 2; ++j)
    for (int i = 1; i <= m[j]; ++i) {
      int w = std::lower_bound(key + 1, key + tot + 1, pos[j][i]) - key;
      ban[j][w] = 1;
    }
  memset(f, 0xcf, sizeof(f));
  f[0][0] = f[0][1] = 0;
  g[0][1] = {0, 0};
  for (int i = 1; i <= tot; ++i) {
    for (int j = 0; j < 2; ++j) {
      if (!ban[j][i]) {
        f[i][j] = f[i - 1][j] + key[i] - key[i - 1];
        g[i][j] = {i - 1, j};
      } else {
        if (f[i - 1][j] + key[i] - key[i - 1] - 1 >= t) {
          f[i][j] = f[i - 1][j] + key[i] - key[i - 1] - t;
          g[i][j] = {i - 1, j};
        }
      }
    }
    for (int j = 0; j < 2; ++j)
      if (!ban[j][i]) {
        if (std::min(t, f[i][j ^ 1]) > f[i][j]) {
          f[i][j] = std::min(t, f[i][j ^ 1]);
          g[i][j] = {i, j ^ 1};
        }
      }
  }
  int max = std::max(f[tot][0], f[tot][1]);
  if (max < 0)
    puts("No");
  else {
    puts("Yes");
    if (max == f[tot][0])
      dfs(tot, 0);
    else
      dfs(tot, 1);
    std::reverse(ans1.begin(), ans1.end());
    std::reverse(ans2.begin(), ans2.end());
    printf("%d\n", (int)ans1.size());
    for (int i : ans1) printf("%d ", i);
    putchar('\n');
    printf("%d\n", (int)ans2.size());
    for (auto i : ans2) printf("%d %d\n", i.first, i.second);
  }
  return 0;
}
