#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
long long n, t, a[N], x[N], b[N];
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;
    }
  for (int i = 1; i < n; i++)
    if (x[i] > x[i + 1]) {
      puts("No");
      return 0;
    }
  b[n] = a[n] + t + 100;
  for (int i = n - 1; i >= 1; i--) b[i] = a[i + 1] + t - (x[i] == i);
  for (int i = 1; i < n; i++) {
    if (x[i] < x[i + 1] && x[i] != i || b[i] == b[i + 1]) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  cout << endl;
  return 0;
}
