#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 4;
long long INF = 1e18 + 1000000000;
long long a[N], b[N], c[N];
long long val[N];
long long match[N];
long long lo[N], hi[N];
int main() {
  int n;
  long long t;
  cin >> n >> t;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &val[i]);
    hi[i] = INF;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &match[i]);
    lo[match[i]] = max(lo[match[i]], val[i]);
    if (i > match[i]) {
      int bb = match[i] + 1, e = i;
      a[bb]++;
      a[e + 1]--;
      if (match[i] > 1) {
        b[match[i]]--;
        b[1]++;
      }
      if (i < n) {
        b[i + 1]++;
      }
      hi[match[i]] = min(hi[match[i]], val[match[i]]);
    } else if (match[i] == i) {
      b[1]++;
      if (match[i] + 1 <= n) {
        hi[match[i]] = min(hi[match[i]], val[match[i] + 1]);
      }
    } else {
      int bb = i, ee = match[i] - 1;
      c[bb]++;
      c[ee + 1]--;
      if (i > 1) {
        b[1]++;
        b[i]--;
      }
      if (match[i] < n) {
        b[match[i] + 1]++;
      }
      if (match[i] + 1 <= n) {
        hi[match[i]] = min(hi[match[i]], val[match[i] + 1]);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    a[i] += a[i - 1];
    b[i] += b[i - 1];
    c[i] += c[i - 1];
    if (a[i]) {
      lo[i] = max(lo[i], val[i - 1]);
    }
    if (b[i]) {
      lo[i] = max(lo[i], val[i]);
    }
    if (c[i]) {
      lo[i] = max(lo[i], val[i + 1]);
    }
    lo[i] += t;
    hi[i] += t - 1;
    lo[i] = max(lo[i], lo[i - 1] + 1);
    if (lo[i] > hi[i]) {
      printf("No");
      return 0;
    }
  }
  printf("Yes\n");
  for (int i = 1; i <= n; i++) {
    printf("%lld ", lo[i]);
  }
}
