#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
long long a[N], b[N];
int x[N];
void NO() {
  cout << "No\n";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> n >> t;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += t;
  }
  a[n + 1] = 3e18;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  if (x[n] != n) NO();
  long long value = 1;
  for (int i = 1; i <= n; i++) {
    if (x[i] != i && x[i] != x[i + 1]) NO();
    if (x[i] == i) {
      value = max(value, a[i]);
    } else {
      value = max(value, a[i + 1]);
    }
    if (value >= a[x[i] + 1]) NO();
    b[i] = value++;
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; i++) cout << b[i] << ' ';
  cout << '\n';
  return 0;
}
