#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
long long n, m, l, a[MAXN], x[MAXN];
long long c[MAXN], d[MAXN], b[MAXN];
int main() {
  scanf("%I64d%I64d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &x[i]);
    if (x[i] < i || x[i - 1] > x[i]) return printf("No\n"), 0;
    c[i]++;
    c[x[i]]--;
    d[x[i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    c[i] += c[i - 1];
    l = max(b[i - 1] + 1, a[i] + m);
    if (c[i]) l = max(l, a[i + 1] + m);
    if (d[i] && i < n && l >= a[i + 1] + m) return printf("No\n"), 0;
    b[i] = l;
  }
  printf("Yes\n");
  for (int i = 1; i <= n; i++) printf("%I64d ", b[i]);
  return 0;
}
