#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const long long INFF = 3e18;
const int INF = 1e9;
const int mod = 1e9 + 7;
const int MAX = 5e5 + 7;
long long a[MAX];
int x[MAX];
long long ans[MAX];
int lsum[MAX];
int main(void) {
  int n;
  scanf("%d", &n);
  ;
  long long t;
  scanf("%lld", &t);
  ;
  for (int i = (1); i < (n + 1); ++i) scanf("%lld", a + i);
  for (int i = (1); i < (n + 1); ++i) scanf("%d", x + i);
  for (int i = (1); i < (n); ++i)
    if (x[i] > x[i + 1]) {
      puts("No");
      return 0;
    }
  for (int i = (1); i < (n + 1); ++i) {
    if (x[i] < i) {
      puts("No");
      return 0;
    }
  }
  for (int i = n; i >= 1; --i) {
    if (i == n)
      ans[i] = INFF;
    else
      ans[i] = ans[i + 1] - 1;
  }
  for (int i = (1); i < (n + 1); ++i) {
    if (x[i] != n) {
      ans[x[i]] = min(ans[x[i]], a[x[i] + 1] + t - 1);
    }
    if (ans[x[i]] < a[i] + t) {
      puts("No");
      return 0;
    }
    if (x[i] != i && ans[x[i] - 1] < a[x[i]] + t) {
      puts("No");
      return 0;
    }
  }
  for (int i = n - 1; i >= 1; --i) ans[i] = min(ans[i], ans[i + 1] - 1);
  for (int i = (1); i < (n + 1); ++i) {
    lsum[i + 1]++;
    lsum[x[i] + 1]--;
  }
  for (int i = (1); i < (n + 1); ++i) {
    lsum[i] += lsum[i - 1];
    if (lsum[i]) {
      if (ans[i - 1] < a[i] + t) {
        puts("No");
        return 0;
      }
    } else {
      if (ans[i] < a[i] + t) {
        puts("No");
        return 0;
      }
    }
  }
  puts("Yes");
  for (int i = (1); i < (n + 1); ++i) printf("%lld%c", ans[i], " \n"[i == n]);
  return 0;
}
