#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 10;
long long n, t;
long long a[maxn];
long long x[maxn];
long long fin[maxn];
int main() {
  cin >> n >> t;
  for (long long i = 1; i < n + 1; i++) scanf("%I64d", &a[i]);
  for (long long i = 1; i < n + 1; i++) scanf("%I64d", &x[i]);
  a[n + 1] = 3e17;
  x[n + 1] = x[n];
  fin[n + 1] = 3e18 + 1;
  bool ans = true;
  for (long long i = n; i >= 1; i--) {
    if (x[i] < i || x[i] > x[i + 1]) {
      ans = false;
      break;
    }
    long long tmp;
    if (x[i] != i)
      tmp = fin[i + 1] - 1;
    else
      tmp = a[i + 1] + t - 1;
    fin[i] = (tmp);
    if ((fin[x[i] + 1] - a[i] >= t && -a[x[i] + 1] + fin[x[i]] >= t) &&
        x[i] != n) {
      ans = false;
      break;
    }
    if (fin[i] - a[i + 1] < t && x[i] != i) {
      ans = false;
      break;
    }
  }
  long long end = x[1];
  for (long long i = 1; i < n + 1; i++) {
    if (i > end) end = x[i];
    if (x[i] != end) {
      ans = false;
      break;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
    for (long long i = 1; i < n + 1; i++) {
      printf("%I64d ", fin[i]);
    }
    cout << endl;
  } else {
    cout << "No" << endl;
  }
}
