#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
void Upmax(long long &x, long long y) {
  if (x < y) x = y;
}
long long a[N], b[N], same[N], t;
int n, x[N], tx[N], match[N], last;
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]), same[x[i] + 1] = 1;
  b[1] = a[1] + t;
  for (int i = 1; i <= n; i++) {
    b[x[i] + 1] = a[x[i] + 1] + t;
    if (!same[i]) {
      b[i - 1] = a[i] + t;
    }
  }
  for (int i = 2; i <= n; i++) {
    if (!b[i]) b[i] = b[i - 1] + 1;
  }
  int tail = 1;
  for (int i = 1; i <= n; i++) {
    while (tail <= n && a[i] + t > b[tail]) tail++;
    match[i] = tail;
  }
  last = n + 1;
  for (int i = n; i >= 1; i--) {
    tx[i] = last - 1;
    if (match[i] == i) last = i;
    if (tx[i] != x[i]) {
      return puts("No"), 0;
    }
  }
  puts("Yes");
  for (int i = 1; i <= n; i++) printf("%I64d ", b[i]);
  return 0;
}
