#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(239);
int solve() {
  int n;
  if (!(cin >> n)) return 1;
  long long t;
  cin >> t;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> x(n);
  for (int i = 0; i < n; i++) cin >> x[i], x[i]--;
  for (int i = 0; i < n; i++)
    if (x[x[i]] != x[i]) {
      cout << "No\n";
      return 0;
    }
  for (int i = 0; i < n; i++)
    if (x[i] < i) {
      cout << "No\n";
      return 0;
    }
  for (int i = 1; i < n; i++)
    if (x[i] < x[i - 1]) {
      cout << "No\n";
      return 0;
    }
  vector<long long> b(n);
  for (int i = 0; i < n; i++)
    if (x[i] == i) {
      b[i] = a[i] + t;
      if (i) b[i] = max(b[i], b[i - 1] + 1);
      if (i + 1 < n && a[i + 1] + t <= b[i]) {
        cout << "No\n";
        return 0;
      }
    } else {
      b[i] = a[i + 1] + t;
      if (i) b[i] = max(b[i], b[i - 1] + 1);
    }
  cout << "Yes\n";
  for (int i = 0; i < n; i++) cout << b[i] << ' ';
  cout << endl;
  return 0;
}
int32_t main() {
  ios::sync_with_stdio(0);
  int T = 100;
  for (int i = 1; i <= T; i++) {
    if (solve()) break;
  }
  return 0;
}
