#include <bits/stdc++.h>
using namespace std;
const long long inf = 5e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long t;
  cin >> t;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<int> x(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
    --x[i];
    if (x[i] < i) {
      cout << "No\n";
      return 0;
    }
  }
  vector<int> pref(n);
  vector<long long> lb(n), ub(n, inf);
  for (int i = 0; i < n; ++i) {
    lb[i] = a[i] + t;
  }
  for (int i = 0; i < n; ++i) {
    ++pref[i];
    --pref[x[i]];
    if (x[i] < n - 1) {
      ub[x[i]] = a[x[i] + 1] + t - 1;
    }
  }
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += pref[i];
    if (sum) {
      lb[i] = a[i + 1] + t;
    }
  }
  vector<long long> b(n);
  long long prev = -inf;
  for (int i = 0; i < n; ++i) {
    if (lb[i] > ub[i]) {
      cout << "No\n";
      return 0;
    }
    b[i] = max(lb[i], prev + 1);
    prev = b[i];
    if (b[i] > ub[i]) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  for (int i = 0; i < n; ++i) {
    cout << b[i] << " ";
  }
  cout << "\n";
}
