#include <bits/stdc++.h>
using namespace std;
struct edge {
  int a, l;
};
const int maxN = 200005;
long long a[maxN], b[maxN], t;
int n, x[maxN], v[maxN], bo[maxN];
int main() {
  cin >> n >> t;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) cin >> x[i];
  for (int i = 1; i <= n; ++i) {
    if (x[i] < i) {
      puts("No");
      return 0;
    }
    v[i] += 1;
    v[x[i]] -= 1;
    bo[x[i]] = 1;
  }
  int now = 0;
  for (int i = 1; i <= n; ++i) {
    now += v[i];
    if (bo[i] && now > 0) {
      puts("No");
      return 0;
    }
    if (now)
      b[i] = a[i + 1] + t;
    else {
      b[i] = a[i] + t;
    }
    if (b[i] <= b[i - 1]) b[i] = b[i - 1] + 1;
    if (i < n && bo[i] && b[i] >= a[i + 1] + t) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
  cout << endl;
  return 0;
}
