#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 2000005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
int n, m1, m2, m = 0, t, dp[2][N], pre[2][N], X[N * 2], x1[N], x2[N], tt,
               pos = oo;
bool a[2][N];
vector<int> A;
vector<pair<int, int> > B;
int h(int x) { return lower_bound(X + 1, X + m + 1, x) - X; }
void U(int x, int y, int p, int q) {
  if (p > dp[x][y]) dp[x][y] = p, pre[x][y] = q;
}
int main() {
  scanf("%d%d%d%d", &n, &m1, &m2, &t), X[++m] = 1, X[++m] = n + 1;
  for (int i = (1); i <= (m1); ++i)
    scanf("%d", &x1[i]), X[++m] = x1[i], X[++m] = x1[i] + 1;
  for (int i = (1); i <= (m2); ++i)
    scanf("%d", &x2[i]), X[++m] = x2[i], X[++m] = x2[i] + 1;
  sort(X + 1, X + m + 1), m = unique(X + 1, X + m + 1) - X - 1;
  for (int i = (1); i <= (m1); ++i) a[0][h(x1[i])] = 1;
  for (int i = (1); i <= (m2); ++i) a[1][h(x2[i])] = 1;
  memset(dp, -1, sizeof(dp)), pre[1][0] = 1, dp[0][0] = dp[1][0] = 0;
  for (int i = (0); i <= (m - 1); ++i) {
    for (int j = (0); j <= (1); ++j)
      if (dp[j][i] != -1 && !a[j ^ 1][i])
        U(j ^ 1, i, ((dp[j][i]) < (t) ? (dp[j][i]) : (t)), 1);
    for (int j = (0); j <= (1); ++j)
      if (dp[j][i] != -1 && dp[j][i] + X[i + 1] - X[i] - 1 >= t * a[j][i + 1])
        U(j, i + 1, dp[j][i] + X[i + 1] - X[i] - t * a[j][i + 1], 0);
  }
  tt = dp[1][m] > dp[0][m] ? 1 : 0;
  if (dp[tt][m] == -1) return 0 * printf("No\n");
  printf("Yes\n");
  for (int x = tt, y = m; x || y;)
    if (pre[x][y])
      A.push_back(X[y]), x ^= 1;
    else if (a[x][y])
      B.push_back(make_pair(
          pos = ((X[y] - 1) < (pos - t) ? (X[y] - 1) : (pos - t)), x + 1)),
          y--;
    else
      y--;
  reverse((A).begin(), (A).end()), reverse((B).begin(), (B).end());
  printf("%d\n", A.size());
  for (__typeof((A).begin()) it = (A).begin(); it != (A).end(); it++)
    printf("%d ", *it);
  puts("");
  printf("%d\n", B.size());
  for (__typeof((B).begin()) it = (B).begin(); it != (B).end(); it++)
    printf("%d %d\n", it->first, it->second);
  return 0;
}
