#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, x[N], tr[N];
long long a[N], ans[N];
void add(int x, int y) {
  for (; x <= n; x += x & -x) tr[x] += y;
}
int ask(int x) {
  int ans = 0;
  for (; x; x -= x & -x) ans += tr[x];
  return ans;
}
int main() {
  long long t;
  scanf("%d%I64d", &n, &t);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  bool flag = true;
  for (int i = 1; i <= n; i++)
    if (x[i] < i || x[i] < x[i - 1]) flag = false;
  for (int i = 1; i <= n; i++) add(i, 1);
  for (int i = 1; i <= n; i++)
    if (x[i] > i) {
      add(i, 1);
      add(x[i], -1);
    }
  for (int i = 1; i <= n; i++) {
    int p = ask(i);
    ans[i] = a[min(p, i + 1)] + t;
    if (ans[i] == ans[i - 1]) ans[i]++;
    assert(ans[i] > ans[i - 1]);
  }
  for (int i = 1; i <= n; i++)
    if (x[i] < n && ans[x[i]] - a[x[i] + 1] >= t) flag = false;
  if (!flag)
    printf("No\n");
  else {
    printf("Yes\n");
    for (int i = 1; i <= n; i++) printf("%I64d ", ans[i]);
    printf("\n");
  }
}
