#include <bits/stdc++.h>
using namespace std;
int n;
long long t;
long long l[200005];
long long ret[200005];
long long lhs[200005];
int order[200005];
int main() {
  scanf("%d%lld", &n, &t);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &l[i]);
    ret[i] = l[i] + t;
    lhs[i] = (long long)(4e18);
  }
  queue<pair<int, int> > q;
  for (int i = 0; i < n; i++) {
    scanf("%d", &order[i]);
    if (--order[i] < i) {
      printf("No\n");
      return 0;
    }
    if (i > 0 && order[i] < order[i - 1]) {
      printf("No\n");
      return 0;
    }
    if (order[i] > i) {
      q.push(pair<int, int>(i + 1, order[i]));
      if (order[i] < n - 1) {
        lhs[order[i]] = l[order[i] + 1] + t;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    while (!q.empty() && q.front().first <= i) {
      if (q.front().second >= i) {
        ret[i - 1] = l[i] + t;
        break;
      } else {
        q.pop();
      }
    }
  }
  for (int i = 1; i < n; i++) {
    ret[i] = max(ret[i], ret[i - 1] + 1);
  }
  for (int i = 0; i < n; i++) {
    if (ret[i] >= lhs[i]) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  for (int i = 0; i < n; i++) {
    printf("%lld", ret[i]);
    if (i == n - 1)
      printf("\n");
    else
      printf(" ");
  }
}
