#include <bits/stdc++.h>
using namespace std;
struct Read {
  ifstream f;
  Read(const string &input) { f.open(input); }
  int pos = (1 << 30), sz = 0;
  string s;
  int getNextInt() {
    int ret = 0;
    while (s[pos] == ' ') ++pos;
    while (pos < sz && '0' <= s[pos] && s[pos] <= '9') {
      ret *= 10;
      ret += s[pos] - '0';
      ++pos;
    }
    return ret;
  }
  int nextInt() {
    if (pos >= sz) {
      getline(f, s);
      pos = 0;
      sz = s.size();
    }
    return getNextInt();
  }
};
const int NMAX = 2e5 + 5;
long long a[NMAX], b[NMAX], x[NMAX];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, t;
  cin >> n >> t;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
  }
  for (int i = 2; i <= n; ++i) {
    if (x[i] < x[i - 1] || x[i] < i) {
      cout << "No\n";
      return 0;
    }
  }
  int i = 1, j = 1;
  while (i <= n) {
    while (j <= n && x[j] == x[i]) {
      ++j;
    }
    for (int k = i; k < j; ++k) {
      if (x[k] != k) {
        b[k] = a[k + 1] + t;
      } else {
        b[k] = max(b[k - 1] + 1, a[k] + t);
      }
    }
    if (x[j - 1] != j - 1 || (j <= n && b[j - 1] >= a[j] + t)) {
      cout << "No\n";
      return 0;
    }
    i = j;
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; ++i) {
    cout << b[i] << ' ';
  }
  return 0;
}
