#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0LL) return b;
  return gcd(b, a % b);
}
const int N = 200005;
long long A[N], B[N];
int X[N];
bool mark[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long long T;
  cin >> n >> T;
  for (int i = 1; i <= n; i++) cin >> A[i];
  A[n + 1] = A[n] + 2LL * n;
  bool flag = true;
  X[0] = 0;
  B[0] = 0;
  for (int i = 1; i <= n; i++) {
    mark[i] = false;
    cin >> X[i];
    flag = flag & (X[i] >= i);
    flag = flag & (X[i] >= X[i - 1]);
    if (X[i] == i) {
      mark[i] = true;
      B[i] = A[i + 1] + T - 1;
    }
  }
  for (int i = n; i > 0; i--) {
    if (!mark[i]) B[i] = B[i + 1] - 1LL;
  }
  for (int i = 1; i <= n; i++) {
    flag = flag & (B[i] > B[i - 1]);
    flag = flag & (B[i] >= A[i] + T);
    flag = flag & (B[X[i]] >= A[i] + T);
    if (X[i] != i) flag = flag & (B[X[i] - 1] >= A[X[i]] + T);
    flag = flag & (B[X[i]] < A[X[i] + 1] + T);
  }
  if (!flag) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; i++) cout << B[i] << " ";
  cout << "\n";
  return 0;
}
