#include <bits/stdc++.h>
using namespace std;
const int mod = (1e9) + 7;
const double eps = 1e-6;
const int siz = 2e5 + 5, siz2 = 1049659, siz3 = 5032108;
int n, x[siz];
long long t, a[siz], b[siz];
int main() {
  scanf("%d%I64d", &n, &t);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 1; i <= n; i++) {
    int j = i + 1;
    while (j <= n && x[j] == x[i]) {
      j++;
    }
    j--;
    if (x[j] != j) {
      printf("No\n");
      return 0;
    }
    int len = j - i + 1;
    if (j < n && ((len > 1 && a[j] + t + 1 >= a[j + 1] + t) ||
                  (len == 1 && a[j] + t >= a[j + 1] + t))) {
      printf("No\n");
      return 0;
    }
    for (int k = i; k <= j; k++) {
      if (k < j) {
        b[k] = a[k + 1] + t;
      } else {
        b[k] = len > 1 ? a[k] + t + 1 : a[k] + t;
      }
    }
    i = j;
  }
  printf("Yes\n");
  for (int i = 1; i <= n; i++) {
    printf("%I64d ", b[i]);
  }
  printf("\n");
  return 0;
}
