#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  long long t;
  cin >> n >> t;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<long long> b_min(n), b_max(n);
  for (int i = 0; i < n; ++i) {
    b_min[i] = a[i] + t;
    b_max[i] = 3000000000000000001l;
  }
  set<int> visited_a;
  for (int i = n - 1; i >= 0; --i) {
    visited_a.insert(visited_a.begin(), i);
  }
  vector<int> x(n);
  for (int i = 0; i < n; ++i) {
    int k;
    cin >> k;
    --k;
    x[i] = k;
    if (k < i) {
      cout << "No" << endl;
      return 0;
    }
    if (k > i) {
      auto start = visited_a.find(i);
      auto it = start;
      for (; it != visited_a.end() && *it < k; ++it) {
        b_min[*it] = max(b_min[*it], a[*it + 1] + t);
      }
      visited_a.erase(start, it);
    }
    if (k == n - 1) continue;
    b_max[k] = min(b_max[k], a[k + 1] + t);
    b_min[k + 1] = max(b_min[k + 1], a[k + 1] + t);
  }
  for (int i = 1; i < n; ++i) {
    b_min[i] = max(b_min[i], b_min[i - 1] + 1);
    b_max[n - i - 1] = min(b_max[n - i - 1], b_max[n - i] - 1);
  }
  vector<long long> b(n);
  for (int i = 0; i < n; ++i) {
    if (b_min[i] >= b_max[i]) {
      cout << "No" << endl;
      return 0;
    }
    if (i == 0) {
      b[i] = b_min[i];
      continue;
    }
    long long result = max(b_min[i], b[i - 1] + 1);
    if (result >= b_max[i]) {
      cout << "No" << endl;
      return 0;
    }
    b[i] = result;
  }
  cout << "Yes" << endl;
  for (int i = 0; i < n; ++i) {
    cout << b[i] << " ";
  }
  cout << endl;
}
