#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const double pi = acos(-1.0), eps = 1e-9;
const int N = 3e5 + 111, inf = 1e9, mod = 1e9 + 7;
int n;
long long a[N], b[N], x[N], t;
bool ok = 1;
int main() {
  cin >> n >> t;
  for (int i = 1; i <= n; ++i) cin >> a[i], a[i] += t;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  for (int i = 1; i < n; ++i)
    if (x[i] > x[i + 1]) ok = 0;
  if (!ok) {
    cout << "No";
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    int r = i;
    while (r < n && x[r + 1] == x[i]) ++r;
    if (r == i)
      b[i] = a[i];
    else {
      for (int j = i; j < r; ++j) b[j] = a[j + 1];
      b[r] = b[r - 1] + 1;
    }
    i = r;
  }
  for (int i = 2; i <= n; ++i) b[i] = max(b[i - 1] + 1, b[i]);
  for (int i = 1; i <= n; ++i)
    if (x[i] < n && a[x[i]] <= b[x[i] + 1] && a[x[i] + 1] <= b[x[i]]) {
      cout << "No";
      return 0;
    }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
  return 0;
}
