#include <bits/stdc++.h>
using namespace std;
int n;
int x[200010], ctr[200010], mi[200010];
long long t, a[200010], b[200010];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> t;
  x[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    ctr[i] = 0;
  }
  for (int j = 1; j <= n; j++) {
    cin >> x[j];
    ctr[x[j]]++;
    mi[x[j]] = j;
  }
  for (int i = 1; i <= n; i++) {
    if ((x[i] < i) or (x[i] < x[i - 1])) {
      cout << "No" << endl;
      return 0;
    }
    if ((ctr[i] > 0) && (mi[i] != i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (x[n] != n) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 1; i < n; i++) {
    if ((a[i + 1] == (a[i] + 1)) && (x[i + 1] != x[i]) && (ctr[x[i]] > 1)) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    int m = mi[i];
    if (ctr[i] == 1) {
      b[m] = a[m] + t;
    } else {
      for (int j = 0; j < ctr[i]; j++) {
        b[m - j] = a[m] + t + 1LL - j;
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}
