#include <bits/stdc++.h>
const long long MAXN = 3e5;
using namespace std;
long long INF = 2e18;
long long a[MAXN], x[MAXN], b[MAXN];
long long n, t;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> t;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int q = 0; q < n; q++) {
    cin >> x[q];
    x[q]--;
    if (q >= 1)
      if (x[q] != x[q - 1] && x[q - 1] != q - 1) {
        cout << "No" << endl;
        return 0;
      }
  }
  for (int q = 1; q < n; q++)
    if (x[q] < x[q - 1] || x[q] < q) {
      cout << "No" << endl;
      return 0;
    }
  a[n] = INF;
  for (int q = 0; q < n; q++)
    if (x[q] == q)
      b[q] = a[q + 1] + t - 1;
    else
      b[q] = a[q + 1] + t;
  for (int q = n - 2; q >= 0; q--) {
    if (b[q] >= b[q + 1]) {
      cout << "No" << endl;
      return 0;
    }
    if (b[q] - a[q] < t) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int q = 0; q < n; q++) {
    cout << b[q] << ' ';
  }
  cout << endl;
  return 0;
}
