#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, t;
  cin >> n >> t;
  vector<unsigned long long> v, a(n + 1), x(n);
  for (unsigned long long i = 0; i < n; i++) {
    cin >> a[i];
    a[i] += t;
  }
  for (unsigned long long i = 0; i < n; i++) cin >> x[i];
  a[n] = LLONG_MAX - 1e18 - 10;
  for (unsigned long long i = 1; i < n; i++) {
    if (x[i] < x[i - 1] || x[i] < i + 1 || (x[i - 1] < x[i] && x[i - 1] != i)) {
      cout << "No";
      return 0;
    }
  }
  unsigned long long Mn = 0;
  for (unsigned long long i = 0; i < n; i++) {
    unsigned long long mn, mx;
    if (i < n - 1 && x[i] == x[i + 1])
      mn = max(Mn, a[i + 1]);
    else
      mn = max(Mn, a[i]);
    mx = a[x[i]] - 1;
    if (mn > mx) {
      cout << "No";
      return 0;
    }
    v.push_back(mn);
    Mn = mn + 1;
  }
  cout << "Yes"
       << "\n";
  for (auto it : v) cout << it << " ";
  return 0;
}
