#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
long long a[maxn], b[maxn], x[maxn], n, t;
int main() {
  scanf("%lld%lld", &n, &t);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &x[i]);
  for (long long i = 1; i <= n; ++i)
    if (x[i] < x[i - 1] || x[i] < i) return puts("No") & 0;
  for (int i = 1; i < n; ++i) b[i] = a[i + 1] + t - (x[i] != x[i + 1]);
  b[n] = a[n] + t + 1;
  int tmp = n;
  for (long long i = n; i > 0; --i) {
    if (tmp != x[i] || b[i] <= b[i - 1]) return puts("No") & 0;
    if (b[i - 1] - a[i] < t) tmp = i - 1;
  }
  puts("Yes");
  for (long long i = 1; i <= n; ++i) printf("%lld ", b[i]);
  return 0;
}
