#include <bits/stdc++.h>
const long long N = 200200;
const long long Q = 500500;
const long long mod = 1e9 + 7;
const long long MAGIC = sqrt(N);
using namespace std;
int n;
int s[N];
int x[N];
long long a[N];
long long b[N];
long long l[N];
long long r[N];
void solve() {
  long long t;
  cin >> n >> t;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += t;
    r[i] = 3e18;
  }
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    if (i > 1 && x[i] < x[i - 1] || x[i] < i) {
      cout << "No"
           << "\n";
      return;
    }
    if (x[i] + 1 <= n) {
      r[x[i]] = min(r[x[i]], a[x[i] + 1] - 1);
    }
    l[i] = max(l[i], a[i]);
    s[i]++;
    s[x[i]]--;
    s[i] += s[i - 1];
    if (s[i]) {
      l[i] = max(l[i], a[i + 1]);
    }
  }
  for (int i = n; i >= 1; i--) {
    if (i < n) {
      r[i] = min(r[i], b[i + 1] - 1);
    }
    b[i] = r[i];
    if (b[i] < l[i]) {
      cout << "No"
           << "\n";
      return;
    }
  }
  cout << "Yes"
       << "\n";
  for (int i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
}
bool mtest = false;
int main() {
  ios_base::sync_with_stdio(0);
  int TE = 1;
  if (mtest) cin >> TE;
  while (TE--) solve();
  return 0;
}
