#include <bits/stdc++.h>
using namespace std;
mt19937 mt_rand(chrono::system_clock::now().time_since_epoch().count());
template <typename T1, typename T2>
inline bool upmax(T1& a, T2 b) {
  return (a < b ? (a = b, true) : false);
}
template <typename T1, typename T2>
inline bool upmin(T1& a, T2 b) {
  return (b < a ? (a = b, true) : false);
}
const int maxn = (int)500500;
const int maxlog = 21;
const int base = (int)1e9 + 7;
const long double eps = (long double)1e-7;
const long double PI = acos(-1.);
const int pp = 41;
int n;
long long t;
long long a[maxn];
long long x[maxn];
void fail() {
  cout << "No";
  exit(0);
}
long long b[maxn];
bool les[maxn];
int psum[maxn];
int p[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> t;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    if (x[i] < x[i - 1]) fail();
    if (x[i] < i) fail();
  }
  for (int i = 1; i <= n; i++) {
    b[i] = a[i] + t;
    if (x[i] == i) continue;
    p[i + 1]++;
    p[x[i] + 1]--;
  }
  int bal = 0;
  for (int i = 1; i <= n; i++) {
    bal += p[i];
    if (bal) {
      upmax(b[i - 1], a[i] + t);
    }
  }
  for (int i = 1; i <= n; i++) {
    upmax(b[i], b[i - 1] + 1);
  }
  for (int i = 2; i <= n; i++) {
    les[i] = a[i] + t <= b[i - 1];
    psum[i] = psum[i - 1] + les[i];
  }
  for (int i = 1; i <= n; i++) {
    if (x[i] == n) continue;
    int sum = psum[x[i] + 1] - psum[i];
    if (sum == x[i] + 1 - i) {
      fail();
    }
    sum = psum[x[i]] - psum[i];
    if (sum != x[i] - i) {
      fail();
    }
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
}
