#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t;
  cin >> n >> t;
  vector<long long> A(n + 1, 0);
  vector<long long> X(n + 1, 0);
  vector<long long> OTV(n + 1, 0);
  for (int i = 1; i <= n; i++) cin >> A[i];
  for (int i = 1; i <= n; i++) cin >> X[i];
  if (n == 1) {
    cout << "Yes\n";
    cout << A[1] + t;
    return 0;
  }
  vector<long long> B1(n + 1, 0);
  vector<long long> used(n + 1, 0);
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    if (X[i] < i) flag = false;
  }
  for (int i = 2; i <= n; i++) {
    if (X[i] - X[i - 1] < 0) flag = false;
  }
  if (!flag) {
    cout << "No";
    return 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    if (X[i] == X[i + 1]) {
      OTV[i] = A[i + 1] + t;
    } else if (X[i] == X[i - 1])
      OTV[i] = OTV[i - 1] + 1;
    else
      OTV[i] = A[i] + t;
  }
  OTV[n] = max(A[n] + t, OTV[n - 1] + 1);
  for (int i = 2; i <= n; i++) {
    if (i - 1 == X[i - 1])
      if (A[i] + t <= OTV[i - 1]) flag = false;
  }
  for (int i = 2; i <= n; i++) {
    if (OTV[i] <= OTV[i - 1]) flag = false;
  }
  for (int i = 1; i <= n; i++) {
    if (X[i] != X[X[i]]) flag = false;
  }
  if (!flag) {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; i++) cout << OTV[i] << " ";
}
