#include <bits/stdc++.h>
int n, first[200005];
long long t, A[200005], B[200005];
void fail(int a = -1) {
  std::cout << "No\n";
  std::exit(0);
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cin >> n >> t;
  for (int i = 0; i < (n); ++i) std::cin >> A[i];
  for (int i = 0; i < (n); ++i) std::cin >> first[i];
  for (int i = 0; i < (n); ++i) first[i]--;
  for (int i = 0; i < (n); ++i)
    if (first[i] < i) fail();
  for (int i = 0; i < (n - 1); ++i)
    if (first[i] > first[i + 1]) fail();
  for (int i = 0; i < (n); ++i)
    if (first[i] != i) {
      if (first[first[i]] != first[i]) fail(1);
      if (first[i] + 1 < n && A[first[i] + 1] - 1 == A[first[i]]) fail(2);
    }
  std::vector<bool> back(n);
  int highest = 0;
  for (int i = 0; i < (n); ++i) {
    if (first[i] > i)
      for (int j = (std::max(highest, i + 1)); j < (first[i] + 1); ++j)
        back[j] = true;
    if (first[i] > i) highest = std::max(highest, first[i]);
  }
  for (int i = 0; i < (n); ++i) {
    if (i < n - 1 && back[i + 1])
      B[i] = A[i + 1] + t;
    else
      B[i] = A[i] + t;
    if (i > 0 && B[i] == B[i - 1]) B[i]++;
  }
  std::cout << "Yes\n";
  for (int i = 0; i < (n); ++i) std::cout << B[i] << " ";
  std::cout << "\n";
  return 0;
}
