#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
const unsigned long long oo = 3e18;
unsigned long long n, t;
unsigned long long a[N], b[N], d[N], mn[N], mx[N];
int main() {
  cin >> n >> t;
  for (unsigned long long i = 1; i <= n; i++) cin >> a[i];
  for (unsigned long long i = 1; i <= n; i++) cin >> b[i];
  for (unsigned long long i = 1; i <= n; i++)
    if (b[i] < i || b[i] < b[i - 1]) {
      cout << "No";
      return 0;
    }
  for (unsigned long long i = 1; i <= n; i++)
    d[i] = b[i] - i, mn[i] = a[i] + t, mx[i] = a[n] + t + t;
  unsigned long long c = 0;
  for (unsigned long long i = 1; i <= n; i++) {
    c = max(c, d[i]);
    mn[i] = c > 0 ? max(mn[i], a[i + 1] + t) : mn[i];
    if (c > 0) c--;
  }
  for (unsigned long long i = 1; i <= n; i++)
    if (b[i] < n) mx[b[i]] = min(a[b[i] + 1] + t - 1, mx[b[i]]);
  for (unsigned long long i = n - 1; i >= 1; i--)
    mx[i] = min(mx[i + 1] - 1, mx[i]);
  for (unsigned long long i = 2; i <= n; i++) mn[i] = max(mn[i - 1], mn[i]);
  for (unsigned long long i = 1; i <= n; i++)
    if (mx[i] < mn[i]) {
      cout << "No";
      return 0;
    }
  cout << "Yes\n";
  for (unsigned long long i = 1; i <= n; i++) cout << mx[i] << " ";
}
