#include <bits/stdc++.h>
using namespace std;
long long inf = 5e18;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, i;
  long long t;
  cin >> n >> t;
  vector<long long> up(n, inf), dwn(n), a(n), x(n), c(n, 0);
  for (auto &j : a) cin >> j;
  for (auto &j : x) cin >> j;
  for (i = 0; i < n; i++) dwn[i] = a[i] + t;
  for (i = 0; i < n; i++) {
    if (x[i] < i + 1) {
      cout << "No";
      return 0;
    }
    c[i]++, c[x[i] - 1]--;
    if (x[i] < n) up[x[i] - 1] = min(up[x[i] - 1], a[x[i]] + t - 1);
  }
  long long cnt = 0;
  for (i = 0; i < n; i++) {
    cnt += c[i];
    if (cnt) dwn[i] = a[i + 1] + t;
    if (i) dwn[i] = max(dwn[i], dwn[i - 1] + 1);
  }
  for (i = 0; i < n; i++)
    if (up[i] < dwn[i]) {
      cout << "No";
      return 0;
    }
  cout << "Yes\n";
  for (i = 0; i < n; i++) cout << dwn[i] << ' ';
}
