#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t;
  cin >> n >> t;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] += t;
  }
  vector<long long> x(n);
  cin >> x[0];
  for (long long i = 1; i < n; i++) {
    cin >> x[i];
    if (x[i] < x[i - 1] || x[i] < i + 1) {
      cout << "No";
      return 0;
    }
  }
  vector<long long> b(n);
  b[n - 1] = 3000000000000000000;
  for (long long i = n - 2; i >= 0; i--) {
    if (x[i] > i + 1) {
      b[i] = b[x[i] - 1] - (x[i] - 1 - i);
    } else {
      b[i] = a[i + 1] - 1;
    }
  }
  for (long long i = 0; i < n - 1; i++) {
    if (b[i] > b[i + 1]) {
      cout << "No";
      return 0;
    }
    if (x[i] > i + 1 && b[i] < a[i + 1]) {
      cout << "No";
      return 0;
    }
    if (x[i] == i + 1 && b[i] < a[i]) {
      cout << "No";
      return 0;
    }
    if (x[x[i] - 1] > x[i] && a[x[x[i] - 1] - 1] <= b[i]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (long long i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
  return 0;
}
