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