#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const double eps = 1e-9;
const int INF = 0x3f3f3f3f;
long long a[200050];
long long x[200050];
long long b[200050];
int main(void) {
  int n;
  long long t;
  while (~scanf("%d%lld", &n, &t)) {
    int flag = 1;
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &x[i]);
      x[0] = x[1];
      if ((x[i] != x[i - 1]) && (x[i - 1] != i - 1)) flag = 0;
    }
    if (x[n] != n) flag = 0;
    if (!flag)
      puts("No");
    else {
      int cnt = 0;
      for (int i = 2; i <= n; i++) {
        if (x[i] != x[i - 1]) {
          while (++cnt < i - 1) {
            b[cnt] = max(b[cnt - 1] + 1, a[cnt + 1] + t);
          }
          b[cnt] = max(b[cnt - 1] + 1, a[i - 1] + t);
        }
      }
      while (++cnt < n) {
        b[cnt] = max(b[cnt - 1] + 1, a[cnt + 1] + t);
      }
      b[cnt] = max(b[cnt - 1] + 1, a[n] + t);
      for (int i = 2; i <= n; i++) {
        if (x[i] != x[i - 1] && a[i] + t <= b[i - 1]) {
          return puts("No"), 0;
        }
      }
      puts("Yes");
      for (int i = 1; i <= n; i++) printf("%lld%c", b[i], i == n ? '\n' : ' ');
    }
  }
  return 0;
}
