#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, t;
  cin >> n >> t;
  vector<long long int> a(n + 1), x(n + 1);
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) cin >> x[i];
  for (int i = 1; i <= n; ++i) {
    if (x[i] < x[i - 1] || x[i] < i) {
      cout << "No\n";
      return 0;
    }
  }
  vector<long long int> b(n + 1);
  b[n] = a[n] + t + 1e6;
  for (int i = n - 1; i > 0; --i) b[i] = a[i + 1] + t - (i == x[i]);
  for (int i = 1; i < n; ++i) {
    if ((x[i] < x[i + 1] && x[i] != i) || b[i] == b[i + 1]) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
}
