#include <bits/stdc++.h>
using namespace std;
const int BUF = 200005;
const long long INF = 1LL << 61;
int n;
long long toAdd;
long long arrive[BUF];
int maxOrder[BUF];
void read() {
  cin >> n >> toAdd;
  for (int i = 0; i < n; ++i) {
    cin >> arrive[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> maxOrder[i];
  }
}
void work() {
  for (int i = 0; i + 1 < n; ++i) {
    if (maxOrder[i] != maxOrder[i + 1] &&
        (maxOrder[i] != i + 1 || maxOrder[i] > maxOrder[i + 1])) {
      cout << "No" << endl;
      return;
    }
  }
  if (maxOrder[n - 1] != n) {
    cout << "No" << endl;
    return;
  }
  vector<long long> ans;
  for (int idx = 0; idx < n;) {
    int nexIdx = idx;
    while (nexIdx < n && maxOrder[nexIdx] == maxOrder[idx]) {
      ++nexIdx;
    }
    long long start =
        nexIdx < n ? arrive[nexIdx] + toAdd - (nexIdx - idx) : INF;
    for (int i = 0; i < nexIdx - idx; ++i) {
      if (i == 0 && start + nexIdx - idx - 1 < arrive[idx] + toAdd) {
        cout << "No" << endl;
        return;
      } else if (i > 0 && start + i < arrive[idx + i] + toAdd + 1) {
        cout << "No" << endl;
        return;
      }
      ans.push_back(start + i);
    }
    idx = nexIdx;
  }
  for (int i = 0; i < n; ++i) {
    if (i + 1 < n && maxOrder[i] != maxOrder[i + 1] &&
        arrive[i + 1] + toAdd <= ans[i]) {
      cout << "No" << endl;
      return;
    }
    if (arrive[i] + toAdd > ans[i]) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
  for (int i = 0; i < n; ++i) {
    if (i) cout << ' ';
    cout << ans[i];
  }
  cout << endl;
}
int main() {
  read();
  work();
  return 0;
}
