#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  for (; c < 48 || c > 57; c = getchar())
    if (c == '-') f = -1;
  for (; c > 47 && c < 58; c = getchar()) x = x * 10 + c - 48;
  return x * f;
}
int n;
long long a[200005], b[200005], x[200005], t;
inline void init() {
  n = read();
  t = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  for (int i = 1; i <= n; ++i) x[i] = read();
}
int c[200005];
long long up[200005], dw[200005];
inline void solve() {
  for (int i = 1; i < n; ++i) {
    if (x[i] > x[i + 1]) {
      puts("No");
      return;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (x[i] < i) {
      puts("No");
      return;
    }
  }
  for (int i = 1; i <= n; ++i) {
    up[i] = 3e18;
    dw[i] = a[i] + t;
  }
  for (int i = 1, j = 1, k = n - 1; i < n; ++i) {
    for (j = max(j, i); j <= x[i] - 1; ++j) dw[j] = max(dw[j], a[j + 1] + t);
    dw[x[i]] = max(dw[x[i]], a[i] + t);
    if (x[i] < n) {
      up[x[i]] = min(up[x[i]], a[x[i] + 1] + t - 1);
    }
  }
  b[n] = 3e18;
  for (int i = n - 1; i; --i) {
    up[i] = min(up[i], b[i + 1] - 1);
    if (dw[i] > up[i]) {
      puts("No");
      return;
    }
    b[i] = up[i];
  }
  puts("Yes");
  for (int i = 1; i < n; ++i) printf("%I64d ", b[i]);
  printf("%I64d\n", b[n]);
}
int main() {
  init();
  solve();
  return 0;
}
