#include <bits/stdc++.h>
using namespace std;
const int MAX = 2123456;
int dp[MAX][2], len;
unordered_set<int> check[2];
vector<int> order;
void up(int &a, int b) {
  if (b <= a) return;
  a = b;
}
bool dir[MAX][2];
void out_ans(int now) {
  vector<int> ans1;
  vector<pair<int, int> > ans2;
  for (int i = len - 1; i >= 0; i--) {
    if (dir[i][now]) {
      ans1.push_back(order[i]), now ^= 1;
    }
    if (check[now].count(order[i])) {
      ans2.push_back(make_pair(order[i] - dp[i][now], now + 1));
    }
  }
  sort(ans1.begin(), ans1.end());
  sort(ans2.begin(), ans2.end());
  printf("%d\n", ans1.size());
  for (auto v : ans1) printf("%d ", v);
  printf("\n");
  printf("%d\n", ans2.size());
  for (auto v : ans2) printf("%d %d\n", v.first, v.second);
}
int main() {
  int n, m1, m2, t;
  scanf("%d %d %d %d", &n, &m1, &m2, &t);
  order.push_back(0);
  for (int i = 1; i <= m1; i++) {
    int t;
    scanf("%d", &t);
    order.push_back(t);
    order.push_back(t + 1);
    check[0].insert(t);
  }
  for (int i = 1; i <= m2; i++) {
    int t;
    scanf("%d", &t);
    order.push_back(t);
    order.push_back(t + 1);
    check[1].insert(t);
  }
  order.push_back(n + 1);
  sort(order.begin(), order.end());
  order.erase(unique(order.begin(), order.end()), order.end());
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;
  len = order.size();
  for (int i = 0; i < len - 1; i++) {
    int id = order[i + 1];
    int diff = order[i + 1] - order[i];
    if (!check[0].count(order[i])) {
      if (min(t, dp[i][1]) > dp[i][0])
        dp[i][0] = min(t, dp[i][1]), dir[i][0] = true;
    }
    if (!check[1].count(order[i])) {
      if (min(t, dp[i][0]) > dp[i][1])
        dp[i][1] = min(t, dp[i][0]), dir[i][1] = true;
    }
    if (dp[i][0] >= 0) {
      if (check[0].count(id)) {
        if (dp[i][0] + diff > t) up(dp[i + 1][0], dp[i][0] - t + diff);
      } else {
        up(dp[i + 1][0], dp[i][0] + diff);
      }
    }
    if (dp[i][1] >= 0) {
      if (check[1].count(id)) {
        if (dp[i][1] + diff > t) up(dp[i + 1][1], dp[i][1] - t + diff);
      } else {
        up(dp[i + 1][1], dp[i][1] + diff);
      }
    }
  }
  if (dp[len - 1][0] == -1 && dp[len - 1][1] == -1)
    printf("No\n");
  else {
    printf("Yes\n");
    if (dp[len - 1][0] != -1)
      out_ans(0);
    else
      out_ans(1);
  }
}
