#include <bits/stdc++.h>
using namespace std;
int n;
long long t, A[200005], least[200005], most[200005], res[200005];
int B[200005], v[200005];
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", &B[i]);
  for (int i = (2); i <= (n); i++)
    if (B[i] < B[i - 1]) {
      puts("No");
      return 0;
    }
  for (int i = (1); i <= (n); i++)
    if (B[i] < i) {
      puts("No");
      return 0;
    }
  for (int i = (1); i <= (n); i++) v[i]++, v[B[i]]--;
  for (int i = (1); i <= (n); i++) v[i] += v[i - 1];
  for (int i = (1); i <= (n); i++) most[i] = 3000000000000000000ll;
  for (int i = (1); i <= (n); i++) {
    if (v[i] >= 1)
      least[i] = A[i + 1] + t;
    else
      least[i] = A[i] + t;
    if (B[i] != n) most[B[i]] = min(most[B[i]], A[B[i] + 1] + t - 1);
  }
  for (int i = (1); i <= (n); i++) {
    if (i == 1)
      res[i] = least[i];
    else
      res[i] = max(least[i], res[i - 1] + 1);
    if (res[i] > most[i]) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (int i = (1); i <= (n); i++) printf("%lld ", res[i]);
  puts("");
  return 0;
}
