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