#include <bits/stdc++.h>
using namespace std;
int n;
long long int t;
const int MAXN = 2e5;
long long int as[MAXN + 1];
const long long int MAXB = 3e18;
pair<long long int, long long int> limits[MAXN + 1];
long long int bs[MAXN + 1];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> t;
  for (int i = 0; i < n; ++i) {
    cin >> as[i];
  }
  for (int i = 0; i < n; ++i) {
    limits[i].first = as[i] + t;
    limits[i].second = MAXB;
  }
  bool can = true;
  int max_future = -1;
  for (int i = 0; i < n; ++i) {
    int xi;
    cin >> xi;
    xi--;
    if (xi < i) {
      can = false;
      continue;
    }
    max_future = max(max_future, xi);
    if (max_future > i && i < n - 1) {
      limits[i].first = as[i + 1] + t;
    }
    if (xi < n - 1) {
      limits[xi].second = as[xi + 1] + t - 1;
    }
  }
  if (!can) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = n - 1; i >= 0; --i) {
    long long int a = limits[i].first;
    long long int b = limits[i].second;
    b = (i < n - 1) ? min(b, bs[i + 1] - 1) : b;
    if (a > b) {
      cout << "No" << endl;
      return 0;
    }
    bs[i] = b;
  }
  cout << "Yes" << endl;
  for (int i = 0; i < n; ++i) {
    cout << bs[i] << " ";
  }
  cout << endl;
  return 0;
}
