#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, t;
  cin >> n >> t;
  long long i, j, a[n + 1], x[n + 1];
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    cin >> x[i];
    if (i != 1 && (x[i] < x[i - 1] || x[i] < i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  long long uppb[n + 1], lowb[n + 1];
  long long mx = 3 * 1e18;
  mx = mx + 1;
  for (i = 1; i <= n; i++) lowb[i] = a[i] + t, uppb[i] = mx;
  long long cur = 0;
  for (i = 1; i <= n; i++) {
    for (j = cur + 1; j < x[i]; j++) lowb[j] = a[j + 1] + t;
    cur = x[i] - 1;
    cur = max(i, cur);
  }
  for (i = 1; i <= n; i++)
    if (x[i] != n) uppb[x[i]] = a[x[i] + 1] + t;
  vector<long long> ans;
  long long lastup = mx;
  for (i = n; i >= 1; i--) {
    uppb[i] = min(lastup, uppb[i]);
    if (uppb[i] <= lowb[i]) {
      cout << "No" << endl;
      return 0;
    } else {
      ans.push_back(uppb[i] - 1);
    }
    lastup = uppb[i] - 1;
  }
  reverse((ans).begin(), (ans).end());
  cout << "Yes" << endl;
  for (auto& x : ans) cout << x << " ";
  cout << endl;
  return 0;
}
