#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
inline int pow_(long long a, int n, int p = mod) {
  int r = 1;
  while (n) {
    if (n & 1) r = r * a % p;
    n >>= 1;
    a = a * a % p;
  }
  return r;
}
inline int inv_(int a) { return pow_(a, mod - 2, mod); }
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline void adds(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
inline int mul(int a, int b) { return a * 1ll * b % mod; }
inline void muls(int& a, int b) { a = a * 1ll * b % mod; }
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
int dp[2][3000100];
bool tr[2][3000100];
int main() {
  int n, m1, m2, t;
  scanf("%d%d", &n, &m1);
  scanf("%d%d", &m2, &t);
  vector<int> indices = {0, n + 1};
  vector<vector<int> > v(2);
  for (int i = 0; i < (m1); ++i) {
    int x;
    scanf("%d", &x);
    v[0].push_back(x);
    indices.push_back(x);
    indices.push_back(x - 1);
    indices.push_back(x + 1);
  }
  for (int i = 0; i < (m2); ++i) {
    int x;
    scanf("%d", &x);
    v[1].push_back(x);
    indices.push_back(x);
    indices.push_back(x - 1);
    indices.push_back(x + 1);
  }
  sort(indices.begin(), indices.end());
  indices.resize(unique(indices.begin(), indices.end()) - indices.begin());
  int N = n;
  n = (int)(indices.size()) - 2;
  dp[0][n + 1] = dp[1][n + 1] = N + t + 10;
  for (int i = n; i >= 0; --i) {
    int ci = indices[i];
    bool obs1 = binary_search(v[0].begin(), v[0].end(), ci);
    bool obs2 = binary_search(v[1].begin(), v[1].end(), ci);
    dp[0][i] = dp[0][i + 1];
    if (obs1) dp[0][i] = min(dp[0][i] - t, ci - 1);
    dp[1][i] = dp[1][i + 1];
    if (obs2) dp[1][i] = min(dp[1][i] - t, ci - 1);
    int oldDp = dp[0][i];
    if (dp[1][i] >= ci) {
      int tmpVal = obs1 ? min(ci - 1, dp[1][i] - t) : dp[1][i];
      if (tmpVal > dp[0][i]) {
        dp[0][i] = tmpVal;
        tr[0][i] = true;
      }
    }
    if (oldDp >= ci) {
      int tmpVal = obs2 ? min(ci - 1, oldDp - t) : oldDp;
      if (tmpVal > dp[1][i]) {
        dp[1][i] = tmpVal;
        tr[1][i] = true;
      }
    }
  }
  if (dp[0][0] < t) {
    puts("No");
    return 0;
  }
  puts("Yes");
  vector<int> trans;
  vector<std::pair<int, int> > shots;
  int cur = 0;
  for (int i = 0; i <= n + 1; ++i) {
    int ci = indices[i];
    if (binary_search(v[cur].begin(), v[cur].end(), ci))
      shots.push_back(make_pair(dp[cur][i], cur));
    if (tr[cur][i]) {
      cur ^= 1;
      trans.push_back(ci);
    }
  }
  if (cur) trans.push_back(N + 1);
  printf("%d\n", (int)(trans.size()));
  for (int x : trans) printf("%d ", x);
  putchar(10);
  printf("%d\n", (int)(shots.size()));
  for (std::pair<int, int> s : shots) {
    printf("%d %d\n", s.first, s.second + 1);
  }
  return 0;
}
