#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int a[200005], b[200005];
long long int x[200005], min_ind[200005], max_ind[200005];
int cum_sum[200005] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, h, m, i, j, u, v, t;
  bool possible = true;
  cin >> n >> t;
  for (i = 1; i <= n; i++) {
    min_ind[i] = i;
    max_ind[i] = 0;
  }
  for (i = 1; i <= n; i++) cin >> a[i];
  cin >> x[1];
  cum_sum[1]++;
  cum_sum[x[1]]--;
  for (i = 2; i <= n; i++) {
    cin >> x[i];
    if (x[i] < i || x[i] < x[i - 1]) possible = false;
    cum_sum[i]++;
    cum_sum[x[i]]--;
  }
  if (!possible) {
    cout << "No\n";
    return 0;
  }
  int temp = 0;
  for (i = 1; i <= n; i++) {
    temp += cum_sum[i];
    if (temp > 0) min_ind[i] = i + 1;
    if (x[i] != n) max_ind[x[i]] = x[i] + 1;
  }
  for (i = 1; i <= n; i++) {
    min_ind[i] = a[min_ind[i]] + t;
    if (max_ind[i] != 0)
      max_ind[i] = a[max_ind[i]] + t - 1;
    else
      max_ind[i] = 3000000000000000000;
  }
  long long int cur = 0;
  for (i = 1; i <= n; i++) {
    cur = max(cur + 1, min_ind[i]);
    if (cur > max_ind[i]) {
      possible = false;
      break;
    }
    b[i] = cur;
  }
  if (possible) {
    cout << "Yes\n";
    for (i = 1; i <= n; i++) cout << b[i] << " ";
  } else
    cout << "No";
  return 0;
}
