#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
const long long INF = 3e18;
long long arr[maxn], brr[maxn];
int x[maxn], vis[maxn];
int main() {
  int n;
  long long t;
  scanf("%d%lld", &n, &t);
  for (int i = 1; i <= n; i++) scanf("%lld", arr + i);
  for (int i = 1; i <= n; i++) scanf("%d", x + i), vis[x[i]] = -1;
  bool ok = x[n] == n;
  for (int i = n - 1; i; i--)
    if (x[i] > x[i + 1] || x[i] < i || x[i] != i && x[i] < x[i + 1]) {
      ok = false;
      break;
    }
  if (ok) {
    arr[n + 1] = INF - t + 1;
    for (int i = 1; i <= n; i++) {
      long long l = arr[i] + t, r = INF;
      l = max(l, brr[i - 1] + 1);
      if (vis[i] == -1) {
        l = max(l, arr[i] + t);
        r = min(r, arr[i + 1] + t - 1);
      } else
        l = max(l, arr[i + 1] + t);
      if (l <= r)
        brr[i] = l;
      else {
        ok = false;
        break;
      }
    }
    if (ok) {
      puts("Yes");
      for (int i = 1; i <= n; i++) printf("%lld ", brr[i]);
    } else
      puts("No");
  } else
    puts("No");
  return 0;
}
