#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, t;
  cin >> n >> t;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long x[n];
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long i = 1; i < n; i++) {
    if (x[i] < x[i - 1]) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (long long i = 0; i < n; i++)
    if (x[i] < i + 1) {
      cout << "No" << endl;
      return 0;
    }
  long long ans[n];
  long long c, cur = 0;
  long long lst = 0;
  while (1) {
    if (lst >= n || cur >= n) break;
    c = x[cur];
    long long j = cur + 1;
    long long st = cur;
    while (j < n && x[j] == c) j++;
    for (long long k = lst; k < c; k++) {
      if (st + k - lst + 1 < j)
        ans[k] = arr[st + k - lst + 1] + t;
      else
        ans[k] = (k > 0 ? max(ans[k - 1] + 1, arr[j - 1] + t) : arr[j - 1] + t);
    }
    cur = j;
    lst = c;
  }
  for (long long i = 1; i < lst; i++)
    ans[lst] = max(ans[lst], ans[lst - 1] + 1);
  for (; lst < n; lst++) ans[lst] = ans[lst - 1] + 1;
  for (long long i = 1; i < n; i++) {
    if (x[i] == x[i - 1]) continue;
    if (ans[x[i - 1] - 1] >= arr[i] + t) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (long long i = 0; i < n; i++) cout << ans[i] << ' ';
  cout << endl;
}
