#include <bits/stdc++.h>
using namespace std;
void guan() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long mod2 = 1009050431;
const long long mod3 = 784514251;
const long long hash_mod[] = {998244353, 1009050431, 784514251};
const int INF = 0x7FFFFFFF;
const long long LINF = 0x7FFFFFFFFFFFFFFF;
const double pi = acos(-1.0);
const double eps = 1e-8;
const long long mod = 998244353;
const int maxn = 201010, N = 201010;
typedef struct Node {
  unsigned long long ai;
  int xi;
  int now;
  bool operator<(const struct Node& e) const {
    if (ai == e.ai) return xi > e.xi;
    return ai > e.ai;
  }
} node;
const unsigned long long maxx = (unsigned long long)3 * 1e18;
node arr[maxn];
struct Inf {
  unsigned long long mi, mx, ai;
} b[maxn];
int vis[maxn], mk[maxn];
inline int getpos(int now, int n) {
  for (int i = now - 1; i >= 1; i--)
    if (!mk[i]) return i;
}
unsigned long long ans[maxn];
int main() {
  int n, k, m;
  unsigned long long t;
  guan();
  while (cin >> n >> t) {
    memset(vis, false, sizeof(vis));
    memset(mk, 0, sizeof(mk));
    for (int i = 1; i <= n; ++i) cin >> arr[i].ai;
    for (int i = 1; i <= n; ++i) cin >> arr[i].xi, mk[arr[i].xi] = 1;
    int ok = 1;
    int pos = n + 1;
    int r = n;
    for (int i = n; i >= 1 && ok; i--) {
      if (i == n) {
        if (arr[i].xi != n)
          ok = 0;
        else {
          b[i].mx = maxx;
          b[i].mi = arr[i].ai + t;
        }
      } else {
        if (arr[i].xi == arr[i + 1].xi) {
          b[i].mi = arr[i + 1].ai + t;
          if (arr[i].xi == n)
            b[i].mx = maxx;
          else
            b[i].mx = arr[arr[i].xi + 1].ai + t - 1;
        } else {
          if (arr[i].xi != i)
            ok = 0;
          else {
            b[i].mi = arr[i].ai + t;
            b[i].mx = arr[i + 1].ai + t - 1;
          }
        }
      }
      r = arr[i].xi;
    }
    memset(ans, 0, sizeof(ans));
    int pre = 0;
    if (ok)
      for (int i = n; i >= 1; i--) {
        if (i == n) {
          ans[i] = b[i].mx;
        } else {
          ans[i] = min(ans[i + 1] - 1, b[i].mx);
          if (ans[i] < b[i].mi) ok = 0;
        }
      }
    if (ok) {
      cout << "Yes" << endl;
      for (int i = 1; i <= n; ++i) cout << ans[i] << " ";
      cout << endl;
    } else
      cout << "No" << endl;
  }
  return 0;
}
