#include <bits/stdc++.h>
using namespace std;
int N;
signed long long T;
signed long long A[202020];
int X[202020];
signed long long L[202020], R[202020], C[202020];
int S[202020];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N >> T;
  for (i = 0; i < (N); i++) cin >> A[i];
  A[N] = 2 * 1000000000000000000LL;
  for (i = 0; i < (N); i++) {
    cin >> X[i];
    if (X[i] < i + 1) {
      cout << "No" << endl;
      return;
    }
    if (i && X[i] < X[i - 1]) {
      cout << "No" << endl;
      return;
    }
    int D = X[i] - (i + 1);
    if (i) S[i] += S[i - 1];
    S[i]++;
    S[i + D]--;
    if (X[i] != N) R[i + D] = A[i + D + 1] + T - 1;
    if (S[i]) {
      L[i] = max(A[i + 1] + T, L[i - 1] + 1);
    } else {
      L[i] = max(A[i] + T, L[i - 1] + 1);
    }
    if (R[i] && L[i] > R[i]) return (void)printf("No\n");
  }
  cout << "Yes" << endl;
  for (i = 0; i < (N); i++) cout << L[i] << " ";
  cout << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
