#include <bits/stdc++.h>
using namespace std;
long long a[200006], b[200006], x[200006], nrel, t;
int main() {
  cin >> nrel >> t;
  for (int i = 1; i <= nrel; i++) cin >> a[i];
  a[nrel + 1] = (long long)3000000000000000000 - 1;
  for (int i = 1; i <= nrel; i++) cin >> x[i];
  for (int i = 1; i <= nrel; i++)
    if (x[i] < i or x[i] < x[i - 1]) {
      cout << "No";
      return 0;
    }
  for (int i = 1; i <= nrel; i++) {
    while (x[i] == x[i + 1]) {
      long long mini = t + a[i + 1];
      b[i] = mini;
      i++;
    }
    b[i] = t + a[i];
    if (b[i] == b[i - 1]) b[i]++;
    if (a[i + 1] + t <= b[i]) {
      cout << "No";
      return 0;
    }
  }
  if (b[nrel] > (long long)3000000000000000000) {
    cout << "No";
    return 0;
  }
  for (int i = nrel; i >= 1; i--) {
    int j = i;
    while (a[j] + t <= b[j - 1]) j--;
    for (int k = j; k <= i; k++)
      if (x[k] != i) {
        cout << "No";
        return 0;
      }
    i = j;
  }
  cout << "Yes" << '\n';
  for (int i = 1; i <= nrel; i++) cout << b[i] << ' ';
  return 0;
}
