#include <bits/stdc++.h>
using namespace std;
long long a[202020], t, b[202020];
int n, x[202020];
pair<int, int> q[202020];
int main() {
  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 = 1;
  for (int i = 1; i < n; i++)
    if (x[i] > x[i + 1]) flag = 0;
  for (int i = 1; i <= n; i++)
    if (x[i] < i) flag = 0;
  for (int i = 1; i <= n; i++) {
    if (x[i] == i) {
      b[i] = a[i] + t;
      continue;
    }
    if (x[i] > i) {
      for (int j = i + 1; j <= x[i]; j++)
        if (x[j] > x[i]) flag = 0;
      for (int j = i + 1; j <= x[i]; j++) b[j - 1] = a[j] + t;
      b[x[i]] = b[x[i] - 1] + 1;
      if (x[i] < n && a[x[i] + 1] + t <= b[x[i]]) flag = 0;
      i = x[i];
    }
  }
  if (!flag)
    puts("No");
  else {
    puts("Yes");
    for (int i = 1; i <= n; i++) printf("%I64d ", b[i]);
    puts("");
  }
  return 0;
}
