#include <bits/stdc++.h>
using namespace std;
long long a[200010], t;
int n;
long long b[200010];
int g[200010];
bool no[200010];
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++) {
    int x;
    scanf("%d", &x);
    if (x < i) {
      printf("No\n");
      return 0;
    }
    g[i]++;
    g[x]--;
    no[x] = 1;
  }
  int now = 0;
  b[0] = 0;
  for (int i = 1; i <= n; i++) {
    now += g[i];
    if (now > 0) {
      if (no[i]) {
        printf("No\n");
        return 0;
      }
      b[i] = max(a[i + 1] + t, b[i - 1] + 1);
    } else {
      b[i] = max(a[i] + t, b[i - 1] + 1);
      if (no[i] && (b[i] >= a[i + 1] + t && i != n)) {
        printf("No\n");
        return 0;
      }
    }
  }
  printf("Yes\n");
  for (int i = 1; i <= n; i++) printf("%I64d ", b[i]);
  printf("\n");
  return 0;
}
