#include <bits/stdc++.h>
using namespace std;
int n;
long long t, maxa[300005], mina[300005], a[300005], x[300005];
int dm;
void updatemin(int i, int j) {
  for (int(k) = max(dm + 1, i); (k) < (j + 1); (k)++) {
    mina[k] = max(mina[k], a[k + 1] + t);
  }
}
void maxu(int i, long long v) { maxa[i] = min(maxa[i], v); }
void minu(int i, long long v) { mina[i] = max(mina[i], v); }
void func() {
  for (int(i) = 2; (i) < (n + 1); (i)++) {
    mina[i] = max(mina[i - 1] + 1, mina[i]);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> t;
  for (int(i) = 1; (i) <= (n); (i)++) cin >> a[i];
  for (int(i) = 1; (i) <= (n); (i)++) cin >> x[i];
  bool ans = true;
  for (int(i) = 1; (i) <= (n); (i)++) maxa[i] = LLONG_MAX;
  for (int(i) = 1; (i) <= (n); (i)++) mina[i] = a[i] + t;
  for (int(i) = 1; (i) <= (n); (i)++) {
    if (x[i] == i) continue;
    if (x[i] < i || x[i] < x[i - 1]) {
      ans = false;
      break;
    }
    updatemin(i, x[i] - 1);
    dm = x[i] - 1;
    if (x[i] < n) maxu(x[i], a[x[i] + 1] + t - 1);
  }
  func();
  for (int(i) = 1; (i) <= (n); (i)++) {
    if (maxa[i] < mina[i]) {
      ans = false;
      break;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
    for (int(i) = 1; (i) <= (n); (i)++) cout << mina[i] << ' ';
    cout << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
