#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1.0);
const long long mod = 1000000007;
const double eps = 1e-12;
const int inf = 0x3f3f3f3f;
const int maxn = 2e6 + 20;
const int maxm = 5e3 + 20;
inline int in(int &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return -1;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
struct node {
  long long a, x;
} no[maxn];
long long b[maxn];
int pre[maxn];
int main() {
  int n;
  scanf("%d", &n);
  long long t;
  scanf("%lld", &t);
  for (int i = 1; i <= n; ++i) scanf("%lld", &no[i].a);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &no[i].x), b[i] = 3e18;
    if (no[i].x < i) return 0 * puts("No");
  }
  for (int i = 2; i <= n; ++i)
    if (no[i].x < no[i - 1].x) return 0 * puts("No");
  for (int i = 1; i <= n; ++i) {
    long long x = no[i].a;
    int pos = no[i].x;
    if (pos == n) continue;
    b[pos] = min(b[pos], no[pos + 1].a + t - 1);
  }
  for (int i = n - 1; i; --i) {
    b[i] = min(b[i + 1] - 1, b[i]);
  }
  for (int i = 1; i < n; ++i) {
    pre[i] += pre[i - 1];
    if (b[i] >= no[i + 1].a + t) ++pre[i];
  }
  for (int i = 1; i < n; ++i) {
    int pos = no[i].x;
    if (pos == i) continue;
    if (pre[pos - 1] - pre[i - 1] == pos - i) continue;
    return 0 * puts("No");
  }
  long long lim = 3e18;
  for (int i = 1; i <= n; ++i) {
    if (b[i] >= 1 && b[i] <= lim) continue;
    if (i < n && b[i] < b[i + 1]) continue;
    return 0 * puts("No");
  }
  puts("Yes");
  for (int i = 1; i <= n; ++i) {
    printf("%lld ", b[i]);
  }
  return 0;
}
