#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
T abs(T x) {
  return x < 0 ? -x : x;
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
bool chmin(T& x, const T& y) {
  if (x > y) {
    x = y;
    return true;
  }
  return false;
}
template <typename T>
bool chmax(T& x, const T& y) {
  if (x < y) {
    x = y;
    return true;
  }
  return false;
}
int main(int, char**) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  long long t;
  while (cin >> n >> t) {
    long long a[n];
    int x[n];
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    for (int i = 0; i < n; ++i) {
      cin >> x[i];
      --x[i];
    }
    const long long MAX = (long long)1e+18 * 3 - 42;
    long long l[n];
    long long r[n];
    for (int i = 0; i < n; ++i) {
      l[i] = 1;
      r[i] = MAX;
    }
    for (int i = 0; i < n; ++i) {
      long long v = a[i] + t;
      chmax(l[x[i]], v);
      if (x[i] + 1 < n) {
        chmin(r[x[i]], a[x[i] + 1] + t - 1);
      }
    }
    for (int i = 0; i < n; ++i) {
      if (i + 1 < n && x[i] > i) {
        chmax(l[i], a[i + 1] + t);
      }
    }
    long long b[n + 1];
    b[n] = MAX;
    bool ok = true;
    for (int i = n - 1; i >= 0; --i) {
      b[i] = min(b[i + 1] - 1, r[i]);
      ok &= b[i] >= l[i];
    }
    if (!ok) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
      for (int i = 0; i < n; ++i) {
        if (i) {
          cout << " ";
        }
        cout << b[i];
      }
      cout << endl;
    }
  }
  cerr << "Time execute: " << clock() / (double)CLOCKS_PER_SEC << " sec"
       << endl;
  return 0;
}
