#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T, typename T1>
T amax(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
const long long INF = 3e18;
const int32_t M = 1e9 + 7;
const int32_t MM = 998244353;
const long long N = 2e5 + 5;
long long a[N], x[N], b[N];
long long push_front[N];
void solve() {
  long long n, t;
  cin >> n >> t;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  a[n] = INF;
  for (long long i = 0; i < n; i++) {
    b[i] = INF;
  }
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
    x[i]--;
    if (x[i] < i) {
      cout << "No";
      return;
    }
    amin(b[x[i]], a[x[i] + 1] + t - 1);
    push_front[i + 1]++;
    push_front[x[i] + 1]--;
  }
  for (long long i = n - 2; i >= 0; i--) {
    amin(b[i], b[i + 1] - 1);
  }
  for (long long i = 1; i < n; i++) {
    push_front[i] += push_front[i - 1];
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] + t > b[i]) {
      cout << "No";
      return;
    }
    if (push_front[i] > 0 && a[i] + t > b[i - 1]) {
      cout << "No";
      return;
    }
  }
  cout << "Yes\n";
  for (long long i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
