#include <bits/stdc++.h>
using namespace std;
const int maxn = 200007;
const long long inf = 3e18 + 1;
int n;
long long T;
long long a[maxn];
long long b_ma[maxn];
long long b_mi[maxn];
long long b[maxn];
int x[maxn];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> T;
  for (int i = (0); i < (n); ++i)
    cin >> a[i], b_ma[i] = inf, b_mi[i] = a[i] + T;
  for (int i = (0); i < (n); ++i) cin >> x[i], x[i]--;
  set<int> has;
  for (int i = (0); i < (n); ++i) has.insert(i);
  for (int i = (0); i < (n); ++i) {
    int ed = x[i];
    if (ed < i) return cout << "No\n", 0;
    for (auto it = has.lower_bound(i + 1); it != has.end() && (*it) <= ed;) {
      b_mi[*it - 1] = max(b_mi[*it - 1], a[*it] + T);
      it = has.erase(it);
    }
    if (ed != n - 1) b_ma[ed] = min(b_ma[ed], a[ed + 1] + T);
  }
  for (int i = (1); i < (n); ++i) b_mi[i] = max(b_mi[i], b_mi[i - 1] + 1);
  for (int i = (n - 2); i >= (0); --i) b_ma[i] = min(b_ma[i + 1] + 1, b_ma[i]);
  for (int i = (0); i < (n); ++i) {
    if (b_mi[i] >= b_ma[i]) return cout << "No\n", 0;
    long long res = b_mi[i];
    if (i) res = max(b[i - 1] + 1, res);
    if (res >= b_ma[i]) return cout << "No\n", 0;
    b[i] = res;
  }
  cout << "Yes\n";
  for (int i = (0); i < (n); ++i) cout << b[i] << " ";
  cout << endl;
  return 0;
}
