#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, t, a[200001], x[200001], b[200001];
  cin >> n >> t;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int can = 1;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
    if (i > 1 && x[i] != x[i - 1]) {
      can &= x[i - 1] == i - 1;
      b[i - 1] = a[i] + t - 1;
    } else {
      b[i - 1] = a[i] + t;
    }
  }
  b[n] = a[n] + t + 1;
  can &= x[n] == n;
  for (int i = 2; i <= n; ++i) can &= b[i - 1] < b[i];
  if (!can) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
  cout << endl;
  return 0;
}
