#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long int MAX = 1e9 + 7;
void array_show(int *array, int array_n, char middle = ' ') {
  for (int i = 0; i < array_n; i++)
    printf("%d%c", array[i], (i != array_n - 1 ? middle : '\n'));
}
void array_show(long long int *array, int array_n, char middle = ' ') {
  for (int i = 0; i < array_n; i++)
    printf("%lld%c", array[i], (i != array_n - 1 ? middle : '\n'));
}
void array_show(vector<int> &vec_s, int vec_n = -1, char middle = ' ') {
  if (vec_n == -1) vec_n = vec_s.size();
  for (int i = 0; i < vec_n; i++)
    printf("%d%c", vec_s[i], (i != vec_n - 1 ? middle : '\n'));
}
void array_show(vector<long long int> &vec_s, int vec_n = -1,
                char middle = ' ') {
  if (vec_n == -1) vec_n = vec_s.size();
  for (int i = 0; i < vec_n; i++)
    printf("%lld%c", vec_s[i], (i != vec_n - 1 ? middle : '\n'));
}
int main() {
  long long int n, m;
  int i, j, k;
  long long int a, b, c;
  cin >> n >> m;
  vector<long long int> va(n), vx(n), vb(n);
  for (i = 0; i < n; i++) {
    cin >> va[i];
  }
  for (i = 0; i < n; i++) {
    cin >> vx[i];
    vx[i]--;
    if (vx[i] < i || (i > 0 && vx[i] < vx[i - 1])) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
    j = vx[i];
    if (vx[j] != j) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (vx[i] == i) {
      vb[i] = va[i] + m;
      if (i > 0 && vb[i - 1] >= vb[i]) vb[i] = vb[i - 1] + 1;
      if (i < n - 1 && vb[i] >= va[i + 1] + m) {
        cout << "No" << endl;
        return 0;
      }
    } else
      vb[i] = va[i + 1] + m;
  }
  cout << "Yes" << endl;
  array_show(vb);
}
