#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 200005;
int n, x[N];
ll t, a[N], b[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> t;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    if (x[i] < i || x[i] < x[i - 1]) {
      puts("No");
      return 0;
    }
  }
  for (int i = 1; i < n; i++) {
    b[i] = a[i + 1] + t - (x[i] != x[i + 1]);
    if (b[i] == b[i - 1]) {
      puts("No");
      return 0;
    }
  }
  int tmp = n;
  for (int i = n; i > 0; --i) {
    if (tmp != x[i]) {
      puts("No");
      return 0;
    }
    if (b[i - 1] - a[i] < t) tmp = i - 1;
  }
  b[n] = a[n] + t * 2;
  cout << "Yes" << endl;
  for (int i = 1; i <= n; i++) cout << b[i] << ' ';
  return 0;
}
