#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long ksm(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = (r * a) % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
void exgcd(long long a, long long b, long long &x, long long &y, long long &d) {
  if (!b)
    d = a, x = 1, y = 0;
  else
    exgcd(b, a % b, y, x, d), y -= a / b * x;
}
long long inv(long long a, long long p) {
  long long x, y, d;
  exgcd(a, p, x, y, d);
  x = (x % p + p) % p;
  return x;
}
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
const int maxn = 2e5 + 100;
long long n, m, k, t;
long long a[maxn], b[maxn], x[maxn];
int main() {
  cin >> n >> t;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= n; i++) {
    if (x[i] < i || x[i] < x[i - 1]) {
      puts("No");
      return 0;
    }
  }
  b[n] = 3E18;
  for (int i = 1; i <= n - 1; i++) {
    if (x[i] == x[i + 1]) {
      b[i] = a[i + 1] + t;
    } else {
      b[i] = a[i + 1] + t - 1;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (b[i] == b[i - 1]) {
      b[i - 1]--;
    }
  }
  int ok = 1, now = n;
  for (int i = n; i >= 1; i--) {
    if (now != x[i]) {
      ok = 0;
      break;
    }
    if (b[i - 1] < a[i] + t) {
      now = i - 1;
    }
  }
  if (ok) {
    puts("Yes");
    for (int i = 1; i <= n; i++) cout << b[i] << " ";
    puts("");
  } else {
    puts("No");
  }
  return 0;
}
