#include <bits/stdc++.h>
using namespace std;
long long int a[200009], b[200009], x[200009];
int dp[200009];
bool mar[200009], curposok[200009], canmoveback[200009];
int main() {
  int i, j, t1, t2, t3, t4, n;
  long long int buf1, buf2, buf3, buf4, t;
  scanf("%d %lld", &n, &t);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for (i = 1; i <= n; i++) {
    scanf("%lld", &x[i]);
    b[i] = 3e18;
  }
  b[n + 1] = 3e18;
  for (i = 1; i <= n; i++) {
    if (x[i] == n) {
      continue;
    }
    b[x[i]] = min(b[x[i]], a[x[i] + 1] + t - 1);
    mar[x[i]] = 1;
  }
  for (i = n; i >= 1; i--) {
    if (!mar[i]) {
      b[i] = b[i + 1] - 1;
    }
  }
  for (i = 1; i <= n; i++) {
    if (a[i] + t <= b[i]) {
      curposok[i] = 1;
    }
    if (!curposok[i]) {
      printf("No\n");
      return 0;
    }
    if (i == 1) {
      continue;
    }
    canmoveback[i] = (a[i] + t <= b[i - 1]);
  }
  for (i = n; i >= 1; i--) {
    dp[i] = (canmoveback[i]) ? (1 + dp[i + 1]) : 0;
  }
  for (i = 1; i <= n; i++) {
    t1 = i + dp[i + 1];
    if (t1 != x[i]) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  for (i = 1; i <= n; i++) {
    printf("%lld ", b[i]);
  }
  printf("\n");
  return 0;
}
