#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, is = 1;
  long long t;
  cin >> n >> t;
  ++n;
  vector<long long> a(n), x(n);
  for (int i = 1; i < n; ++i) cin >> a[i];
  for (int i = 1; i < n; ++i) cin >> x[i];
  vector<int> open(n + 1, 0), close(n + 1, 0);
  vector<int> bad(n + 1, 0);
  for (int i = 1; i < n; ++i) {
    int k = x[i];
    if (k < i) is = 0;
    open[i + 1]++;
    close[k + 1]++;
    bad[k + 1] = 1;
  }
  int cnt = 0;
  vector<long long> res(n);
  res[0] = 0;
  for (int i = 2; i < n; ++i) {
    cnt += open[i];
    cnt -= close[i];
    if (cnt > 0 and bad[i]) is = 0;
    long long mn = max(a[i - 1] + t, res[i - 2] + 1);
    if (cnt > 0 and !bad[i]) mn = max(mn, a[i] + t);
    if (cnt == 0 and bad[i] and mn >= a[i] + t) is = 0;
    res[i - 1] = mn;
  }
  res[n - 1] = 3e18;
  if (is) {
    cout << "Yes\n";
    for (int i = 1; i < n; ++i) {
      cout << res[i] << ' ';
    }
    cout << '\n';
  } else
    cout << "No\n";
}
