#include <bits/stdc++.h>
using namespace std;
long long a[200100];
long long x[200100];
long long ans[200100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long MAX = 3e18;
  long long n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    if (x[i] < x[i - 1] || x[i] < i || (x[i] > x[i - 1] && x[i - 1] > i - 1)) {
      cout << "No";
      return 0;
    }
  }
  int last = 0;
  for (int i = 1; i <= n; i++) {
    if (x[i] == x[i + 1]) {
      continue;
    }
    for (int j = last + 1; j < i; j++) {
      ans[j] = max(ans[j - 1], a[j + 1] + k - 1LL) + 1LL;
    }
    ans[i] = max(ans[i - 1], a[i] + k - 1LL) + 1LL;
    if (i < n && a[i + 1] + k <= ans[i]) {
      cout << "No";
      return 0;
    }
    last = i;
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i] <= ans[i - 1] || ans[i] > MAX) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << '\n';
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
