#include <bits/stdc++.h>
using namespace std;
int n, x[200005];
long long m, a[200005], b[200005];
int main() {
  scanf("%d%lld", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  for (int i = 1; i <= n; i++)
    if (x[i] < x[i - 1] || x[i] < i) {
      printf("No\n");
      return 0;
    }
  b[n] = a[n] + m + 1000000000ll;
  for (int i = n - 1; i >= 1; i--) b[i] = a[i + 1] + m - (i == x[i]);
  for (int i = 1; i < n; i++)
    if ((x[i] < x[i + 1] && x[i] != i) || (b[i] == b[i + 1])) {
      printf("No\n");
      return 0;
    }
  printf("Yes\n");
  for (int i = 1; i <= n; i++) printf("%lld ", b[i]);
  printf("\n");
  return 0;
}
