#include <bits/stdc++.h>
using namespace std;
int n, x[200002];
long long t, a[200002], b[200002];
bool ans = true;
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) b[i] = a[i + 1] + t - (x[i] != x[i + 1]);
  b[n] = a[n] + t + 1;
  for (int i = 1; i <= n; ++i)
    if (x[i] < x[i - 1] || x[i] < i ||
        (x[i - 1] != x[i] && x[i - 1] != i - 1) || b[i] <= b[i - 1])
      ans = false;
  if (ans) {
    printf("Yes\n");
    for (int i = 1; i <= n; ++i) {
      printf("%I64d", b[i]);
      if (i != n) printf(" ");
    }
  } else
    printf("No");
  return 0;
}
