#include <bits/stdc++.h>
template <typename T>
bool ckmax(T &x, T y) {
  return x < y ? x = y, true : false;
}
template <typename T>
bool ckmin(T &x, T y) {
  return x > y ? x = y, true : false;
}
using namespace std;
const long long inf = 1000000000;
const double Pi = acos(-1);
const long long mod = 998244353;
const double eps = 1e-6;
inline long long fpow(long long a, long long b = mod - 2, long long p = mod) {
  a %= p;
  long long res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % p;
    a = 1ll * a * a % p;
    b >>= 1;
  }
  return res;
}
inline long long read() {
  char c = getchar();
  long long x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writesp(long long x) { write(x), putchar(' '); }
inline void writeln(long long x) {
  write(x);
  putchar('\n');
}
inline void evil() {
  puts("No");
  exit(0);
}
long long n, t;
long long a[222222], x[222222];
long long b[222222];
signed main() {
  n = read(), t = read();
  for (long long i = (1), iE = (n); i <= iE; i++) a[i] = read();
  for (long long i = (1), iE = (n); i <= iE; i++) {
    x[i] = read();
    if (x[i] < i) evil();
  }
  for (long long i = (1), iE = (n); i <= iE; i++) b[i] = a[i] + t;
  long long mx = 0;
  for (long long i = (1), iE = (n); i <= iE; i++) {
    mx = max(mx, x[i]);
    if (mx > i) ckmax(b[i], a[i + 1] + t);
  }
  for (long long i = (2), iE = (n); i <= iE; i++) ckmax(b[i], b[i - 1] + 1);
  for (long long L = 1, R = 1; L <= n; L++) {
    if (R <= L) R = L + 1;
    while (R <= n && a[R] + t <= b[R - 1]) ++R;
    if (x[L] != R - 1) evil();
  }
  puts("Yes");
  for (long long i = (1), iE = (n); i <= iE; i++) printf("%lld ", b[i]);
  puts("");
}
