#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, t;
  cin >> n >> t;
  long long last = 0;
  vector<long long> a(n), x(n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; ++i) {
    cin >> x[i];
    --x[i];
  }
  for (long long i = 0; i < n; ++i) {
    if (x[i] < i || x[x[i]] != x[i] || (i && x[i] < x[i - 1])) {
      puts("No");
      return 0;
    }
  }
  vector<long long> ans(n);
  for (long long i = 0; i < n; ++i) {
    if (x[i] == i) {
      if (last == i) {
        ans[i] = a[i] + t;
        ++last;
        continue;
      }
      for (long long j = last; j <= i; ++j) {
        ans[j] = a[i] + t - i + j + 1;
      }
      last = i + 1;
    }
  }
  for (long long i = 0; i < n - 1; ++i) {
    if (i == x[i] && ans[i] >= a[i + 1] + t) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (auto i : ans) cout << i << ' ';
  cout << endl;
}
