#include <bits/stdc++.h>
using namespace std;
vector<long long int> v[((int)(2e5 + 5))];
long long int a[((int)(2e5 + 5))], x[((int)(2e5 + 5))], b[((int)(2e5 + 5))],
    bmx[((int)(2e5 + 5))];
int main() {
  long long int n, t, i, j;
  scanf("%lld %lld", &n, &t);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for (i = 1; i <= n; i++) {
    scanf("%lld", &x[i]);
    v[x[i]].push_back(i);
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j < v[i].size(); j++) b[i] = max(b[i], a[v[i][j]] + t);
  }
  long long int cnt = 0;
  long long int mx = ((long long int)(2000000000000000001));
  for (i = n; i > 0; i--) {
    if (cnt < n - i) {
      printf("No\n");
      return 0;
    }
    if (mx != ((long long int)(2000000000000000001)) && mx + t <= b[i]) {
      printf("No\n");
      return 0;
    }
    if (v[i].size() == 0) {
      bmx[i] = bmx[i + 1] - 1;
      continue;
    }
    if (mx != ((long long int)(2000000000000000001)))
      bmx[i] = mx + t - 1;
    else
      bmx[i] = 3000000000000000000;
    cnt += (long long int)v[i].size();
    for (j = 0; j < v[i].size(); j++) {
      mx = min(mx, a[v[i][j]]);
    }
  }
  if (bmx[1] < 1) {
    printf("No\n");
    return 0;
  }
  for (i = n; i > 0; i--) {
    cnt = b[i];
    b[i] = bmx[i];
    if (i < n) b[i] = min(b[i], b[i + 1] - 1);
    if (b[i] < cnt) {
      printf("No\n");
      return 0;
    }
  }
  long long int r = n;
  long long int l = (long long int)v[n].size() - 1;
  for (i = n; i > 0; i--) {
    if (v[i].size() > 0) sort(v[i].begin(), v[i].end());
  }
  for (i = n; i > 0; i--) {
    if (a[v[r][l]] + t > b[i]) {
      printf("No\n");
      return 0;
    }
    if (v[r].size() - 1 > l && a[v[r][l + 1]] + t > b[i]) {
      printf("No\n");
      return 0;
    }
    l--;
    if (l < 0) {
      r--;
      while (r >= 0 && (long long int)v[r].size() == 0) r--;
      if (r >= 0) l = (long long int)v[r].size() - 1;
    }
  }
  printf("Yes\n");
  for (i = 1; i <= n; i++) printf("%lld ", b[i]);
  return 0;
}
