#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int desll[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const int mod = 1e9 + 7;
const int maxn = 2e5 + 7;
const int maxm = 1e5 + 7;
const double eps = 1e-4;
long long m, n;
long long ar[maxn];
long long b[maxn];
int x[maxn];
int main() {
  scanf("%I64d%I64d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%I64d", &ar[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  for (int i = 2; i <= n; i++) {
    if (x[i] < x[i - 1] || x[i] < i) {
      printf("No\n");
      exit(0);
    }
  }
  int i = 1;
  while (i <= n) {
    int j = i;
    while (j <= n && x[j] == x[i]) {
      j++;
    }
    for (int k = i; k < j; k++) {
      if (x[k] > k)
        b[k] = ar[k + 1] + m;
      else
        b[k] = max(b[k - 1] + 1, ar[k] + m);
    }
    if (x[j - 1] != j - 1 || (j - 1 < n && b[j - 1] >= ar[j] + m)) {
      printf("No\n");
      exit(0);
    }
    i = j;
  }
  printf("Yes\n");
  for (long long i = 1; i <= n; i++)
    printf("%I64d%c", b[i], i == n ? '\n' : ' ');
  return 0;
}
