#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[200005];
int x[200005];
int main() {
  int n;
  long long t;
  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);
    if (x[i] < x[i - 1] || x[i] < i) {
      puts("No");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) b[x[i]] = -1;
  for (int i = 1; i <= n; i++) b[i] += b[i - 1];
  for (int i = 1; i <= n; i++)
    if (b[x[i] - 1] - b[i - 1]) {
      puts("No");
      return 0;
    }
  for (int i = n; i; i--) b[i] -= b[i - 1];
  for (int i = 1; i < n; i++) b[i] += a[i + 1] + t;
  b[n] = a[n] + t + 1;
  for (int i = 1; i <= n; i++)
    if (b[i] < a[i] + t || b[i] <= b[i - 1]) {
      puts("No");
      return 0;
    }
  puts("Yes");
  for (int i = 1; i <= n; i++) printf("%I64d ", b[i]);
  return 0;
}
