#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const double pi = acos(-1.0);
const int maxn = 200000 + 10;
const int mod = 1e9 + 7;
inline char _getchar() {
  static const int BUFSIZE = 100001;
  static char buf[BUFSIZE];
  static char *psta = buf, *pend = buf;
  if (psta >= pend) {
    psta = buf;
    pend = buf + fread(buf, 1, BUFSIZE, stdin);
    if (psta >= pend) return -1;
  }
  return *psta++;
}
inline int read(int &x) {
  x = 0;
  int f = 1;
  char ch = _getchar();
  while ((ch < '0' || ch > '9') && ~ch) {
    if (ch == '-') f = -1;
    ch = _getchar();
  }
  if (ch == -1) return -1;
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = _getchar();
  }
  x *= f;
  return 1;
}
inline int read(long long &x) {
  x = 0;
  int f = 1;
  char ch = _getchar();
  while ((ch < '0' || ch > '9') && ~ch) {
    if (ch == '-') f = -1;
    ch = _getchar();
  }
  if (ch == -1) return -1;
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = _getchar();
  }
  x *= f;
  return 1;
}
inline int read(double &x) {
  char in;
  double Dec = 0.1;
  bool IsN = false, IsD = false;
  in = _getchar();
  if (in == EOF) return -1;
  while (in != '-' && in != '.' && (in < '0' || in > '9')) in = _getchar();
  if (in == '-') {
    IsN = true;
    x = 0;
  } else if (in == '.') {
    IsD = true;
    x = 0;
  } else
    x = in - '0';
  if (!IsD) {
    while (in = _getchar(), in >= '0' && in <= '9') {
      x *= 10;
      x += in - '0';
    }
  }
  if (in != '.') {
    if (IsN) x = -x;
    return 1;
  } else {
    while (in = _getchar(), in >= '0' && in <= '9') {
      x += Dec * (in - '0');
      Dec *= 0.1;
    }
  }
  if (IsN) x = -x;
  return 1;
}
inline int read(float &x) {
  char in;
  double Dec = 0.1;
  bool IsN = false, IsD = false;
  in = _getchar();
  if (in == EOF) return -1;
  while (in != '-' && in != '.' && (in < '0' || in > '9')) in = _getchar();
  if (in == '-') {
    IsN = true;
    x = 0;
  } else if (in == '.') {
    IsD = true;
    x = 0;
  } else
    x = in - '0';
  if (!IsD) {
    while (in = _getchar(), in >= '0' && in <= '9') {
      x *= 10;
      x += in - '0';
    }
  }
  if (in != '.') {
    if (IsN) x = -x;
    return 1;
  } else {
    while (in = _getchar(), in >= '0' && in <= '9') {
      x += Dec * (in - '0');
      Dec *= 0.1;
    }
  }
  if (IsN) x = -x;
  return 1;
}
inline int read(char *x) {
  char *tmp = x;
  char in = _getchar();
  while (in <= ' ' && in != EOF) in = _getchar();
  if (in == -1) return -1;
  while (in > ' ') *(tmp++) = in, in = _getchar();
  *tmp = '\0';
  return 1;
}
long long a[maxn];
long long b[maxn];
int x[maxn];
int flag[maxn];
int main() {
  int n;
  long long t;
  read(n);
  read(t);
  for (int i = 1; i <= n; i++) read(a[i]);
  a[n + 1] = 1e18 + maxn;
  for (int i = 1; i <= n; i++) {
    read(x[i]);
    if (x[i] < i) return 0 * puts("No");
    if (x[i] == i) flag[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (x[x[i]] != x[i]) return 0 * puts("No");
  }
  int pre = 1;
  for (int i = 1; i <= n; i++) {
    if (flag[i] == 1) {
      for (int j = pre; j <= i; j++) {
        b[j] = a[j + 1] + t;
      }
      if (pre != i) {
        b[i] = a[i] + t + 1;
        if (a[i + 1] + t <= b[i]) return 0 * puts("No");
      } else
        b[i] = a[i] + t;
      pre = i + 1;
    }
  }
  puts("Yes");
  for (int i = 1; i <= n; i++) {
    printf("%lld ", b[i]);
  }
  return 0;
}
