#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
void NO() {
  puts("No");
  exit(0);
}
int main() {
  int n;
  long long t;
  scanf("%d%lld", &n, &t);
  vector<long long> a(n);
  for (long long& x : a) scanf("%lld", &x);
  vector<int> x(n);
  for (int& i : x) {
    scanf("%d", &i);
    --i;
  }
  if (x.back() != n - 1) NO();
  vector<long long> b(n);
  for (int i = 0; i < n; ++i) {
    if (i && x[i] < x[i - 1]) NO();
    b[x[i]] = a[i] + t;
  }
  for (int i = 0; i < n - 1; ++i) {
    if (x[i] != i) {
      assert(b[i] <= a[i + 1] + t);
      b[i] = a[i + 1] + t;
    }
  }
  debug() << " ["
          << "b"
             ": "
          << (b) << "] ";
  for (int i = 1; i < n; ++i) {
    b[i] = max(b[i], b[i - 1] + 1);
  }
  vector<int> pref(n);
  for (int i = 1; i < n; ++i) {
    pref[i] = pref[i - 1];
    if (b[i - 1] >= a[i] + t) ++pref[i];
  }
  debug() << " ["
          << "pref"
             ": "
          << (pref) << "] ";
  auto get = [&](int low, int high) {
    return high - low + 1 == pref[high] - (low ? pref[low - 1] : 0);
  };
  for (int i = 0; i < n - 1; ++i) {
    if (x[i] != n - 1 && get(i + 1, x[i] + 1)) NO();
  }
  puts("Yes");
  for (long long z : b) printf("%lld ", z);
  puts("");
}
