#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9;
const long long NMAX = 200011;
const long long inf = 1E9;
const long double eps = 1e-9;
const long long base = 29;
long long a[NMAX];
int x[NMAX];
long long b[NMAX];
signed main() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  cout.precision(20);
  long long n, t;
  cin >> n >> t;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    if (x[i] != x[i - 1]) {
      if (x[i - 1] != i - 1) {
        cout << "No";
        return 0;
      }
    }
  }
  if (x[n] != n) {
    cout << "No";
    return 0;
  }
  for (int i = n; i >= 1; i--) {
    if (x[i] == i) {
      b[i] = a[i + 1] - 1;
    } else {
      b[i] = a[i + 1];
    }
  }
  b[n] = a[n] + 1;
  for (int i = 2; i <= n; i++) {
    if (b[i] <= b[i - 1]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; i++) {
    b[i] += t;
    cout << b[i] << ' ';
  }
  return 0;
};
