#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
int n;
long long t;
long long a[MAXN];
int x[MAXN];
void load() {
  scanf("%d%lld", &n, &t);
  for (int i = 0; i < n; i++) scanf("%lld", a + i);
  for (int i = 0; i < n; i++) scanf("%d", x + i);
}
pair<long long, int> ai[MAXN];
long long b[MAXN];
bool solve() {
  for (int i = 0; i < n; i++) ai[i] = pair<long long, int>(a[i], i);
  sort(ai, ai + n);
  for (int i = 0; i < (n - 1); i++)
    if (x[ai[i].second] > x[ai[i + 1].second]) return false;
  int i = 0;
  while (i < n) {
    int j = i;
    while (j < n && x[ai[j].second] == x[ai[i].second]) j++;
    if (j < n && j - i > 1 && ai[j].first == ai[j - 1].first + 1) return false;
    for (int k = j - 1; k >= i; k--)
      if (x[ai[k].second] != j) return false;
    if (j - i == 1)
      b[ai[i].second] = ai[i].first + t;
    else {
      for (int k = j - 1; k >= i; k--) {
        b[ai[k].second] = ai[j - 1].first + 1 - (j - 1 - k) + t;
      }
    }
    i = j;
  }
  printf("Yes\n");
  for (int i = 0; i < n; i++) printf("%lld ", b[i]);
  printf("\n");
  return true;
}
int main() {
  load();
  if (!solve()) printf("No\n");
  return 0;
}
