#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
int n, x[N];
long long t, a[N], b[N];
long long min(long long a, long long b) { return (a < b) ? a : b; }
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) b[i] = a[n] + n + 1;
  a[n + 1] = a[n] + n + 1;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x[i]);
    b[x[i]] = min(b[x[i]], a[x[i] + 1] - 1);
  }
  for (int i = n - 1; i; --i) b[i] = min(b[i], b[i + 1] - 1);
  for (int i = 1; i <= n; ++i) {
    if (b[x[i]] < a[i]) {
      printf("No\n");
      return 0;
    }
    if (x[i] > i && b[x[i] - 1] < a[x[i]]) {
      printf("No\n");
      return 0;
    }
    if (x[i] < i) {
      printf("No\n");
      return 0;
    }
    if (i > 1 && (x[i] < x[i - 1] || a[i] <= a[i - 1])) {
      printf("No\n");
      return 0;
    }
    if (b[i] <= -t) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  for (int i = 1; i <= n; ++i) printf("%I64d ", b[i] + t);
  printf("\n");
  return 0;
}
