#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const long long inf = 3e18 + 5;
long long a[maxn], x[maxn], b[maxn], t;
int n;
void input() {
  cin >> n >> t;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> x[i];
}
bool slove() {
  for (int i = 1; i < n; i++) {
    if (x[i + 1] < x[i] or x[i] < i) return false;
  }
  for (int i = 1; i < n; i++) {
    if (x[i + 1] == x[i])
      b[i] = a[i + 1] + t;
    else
      b[i] = a[i + 1] + t - 1;
  }
  b[n] = a[n] + t + 3;
  for (int i = 1; i < n; i++) {
    if (b[i + 1] <= b[i]) return false;
  }
  int now = n;
  for (int i = n; i > 1; i--) {
    if (now != x[i]) return false;
    if (b[i - 1] < a[i] + t) now = i - 1;
  }
  return true;
}
void work() {
  if (slove()) {
    puts("Yes");
    for (int i = 1; i <= n; i++) cout << b[i] << ' ';
    cout << endl;
    return;
  } else {
    puts("No");
    return;
  }
}
int main() {
  input();
  work();
  return 0;
}
