#include <bits/stdc++.h>
const int MAXN = 200005;
int nn;
int x[MAXN];
long long tt;
long long a[MAXN];
long long mi[MAXN], mx[MAXN];
long long ans[MAXN];
int tag[MAXN];
int main() {
  using namespace std;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> nn >> tt;
  for (int i = 1; i <= nn; i++) {
    cin >> a[i];
    mi[i] = a[i] + tt;
    mx[i] = (long long)6e18;
  }
  for (int i = 1; i <= nn; i++) {
    cin >> x[i];
    if (x[i] < i) {
      cout << "No\n";
      return 0;
    }
    if (x[i] != nn) mx[x[i]] = a[x[i] + 1] + tt - 1;
    tag[i]++;
    tag[x[i]]--;
  }
  for (int i = 1; i <= nn; i++) {
    tag[i] += tag[i - 1];
    if (tag[i] > 0 && i != nn) mi[i] = a[i + 1] + tt;
    if (mi[i] > mx[i] || ans[i - 1] + 1 > mx[i]) {
      cout << "No\n";
      return 0;
    }
    ans[i] = max(mi[i], ans[i - 1] + 1);
  }
  cout << "Yes\n";
  for (int i = 1; i <= nn; i++) cout << ans[i] << " ";
  cout << "\n";
  return 0;
}
