#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
long long atleast[maxn], atmost[maxn];
long long a[maxn], b[maxn], first[maxn];
long long sum[maxn];
vector<pair<long long, long long> > atleastsub[maxn], atleastadd[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  long long t;
  cin >> n >> t;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> first[i];
    if (first[i] < (first[i - 1]) || i > first[i]) {
      cout << "No";
      return 0;
    }
    if (first[i] > i) {
      atleastadd[i].push_back({i + 1, i});
      int ed = first[i];
      atleastsub[ed].push_back({i + 1, i});
    }
    sum[first[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    atleast[i] = a[i] + t;
    atmost[i] = LLONG_MAX;
    if (first[i] != first[i - 1]) {
      atmost[i - 1] = min(atmost[i - 1], a[i] + t - 1);
    }
    if (sum[i] > i) {
      cout << "No";
      return 0;
    }
  }
  for (int i = n - 1; i >= 1; i--) atmost[i] = min(atmost[i], atmost[i + 1]);
  multiset<long long> s;
  multiset<long long>::iterator it;
  for (int i = 1; i <= n; i++) {
    while (!atleastadd[i].empty()) {
      pair<long long, long long> cur = atleastadd[i].back();
      atleastadd[i].pop_back();
      s.insert(cur.first - cur.second);
    }
    while (!atleastsub[i].empty()) {
      pair<long long, long long> cur = atleastsub[i].back();
      atleastsub[i].pop_back();
      s.erase(s.find(cur.first - cur.second));
    }
    if (!s.empty()) {
      it = s.end();
      it--;
      int pos = min(*it + i, (long long)n);
      atleast[i] = max(atleast[i], a[pos] + t);
    }
    atleast[i] = max(atleast[i - 1] + 1, atleast[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (atleast[i] > atmost[i]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; i++) cout << atleast[i] << ' ';
  return 0;
}
