#include <bits/stdc++.h>
using namespace std;
long long a[200007];
long long b[200007];
long long x[200007];
int main() {
  long long n, t;
  scanf("%I64d", &n);
  ;
  scanf("%I64d", &t);
  ;
  for (int i = 1; i <= n; ++i) scanf("%I64d", &a[i]);
  ;
  for (int i = 1; i <= n; ++i) scanf("%I64d", &x[i]);
  ;
  for (int i = n; i >= 1; --i) {
    if (x[i] < i) {
      cout << "No";
      return 0;
    }
  }
  for (int i = 2; i <= n; ++i) {
    if (x[i] < x[i - 1]) {
      cout << "No";
      return 0;
    }
  }
  for (int i = 1; i <= n - 1; ++i) {
    if (x[i] != x[i + 1] && x[i] != i) {
      cout << "No";
      return 0;
    }
  }
  a[n + 1] = a[n] + 5;
  for (int i = 1; i <= n; ++i) {
    if (x[i] == i)
      b[i] = a[i + 1] + t - 1;
    else
      b[i] = a[i + 1] + t;
    if (b[i] == b[i - 1]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; ++i) printf("%I64d ", b[i]);
  return 0;
}
