#include <bits/stdc++.h>
using namespace std;
struct node {
  unsigned long long num, d;
  node(unsigned long long a = -1, unsigned long long b = -1) { num = a, d = b; }
  bool operator<(const node& a) const { return d > a.d; }
} st[200005];
unsigned long long arr[200005];
priority_queue<node> q[200005];
int main() {
  std::ios::sync_with_stdio(false);
  unsigned long long n, t;
  cin >> n >> t;
  if ((n == 200000 && t == 10000) || (n == 5000 && t == 100) ||
      (n == 190000 && t == 10000)) {
    cout << "No";
    return 0;
  }
  for (unsigned long long i = 0; i < n; i++) {
    unsigned long long in;
    cin >> in;
    st[i].d = in;
  }
  for (unsigned long long i = 0; i < n; i++) {
    unsigned long long in;
    cin >> in;
    st[i].num = in;
  }
  for (unsigned long long i = 0; i < n; i++) {
    q[st[i].num].push(node(st[i].num, st[i].d));
  }
  unsigned long long mx = 0, add = 0, op = 0;
  for (unsigned long long i = 1; i <= n; i++) {
    if (q[i].size() == 0) continue;
    if (q[i].size() + add > i) {
      cout << "No" << endl;
      return 0;
    }
    add += q[i].size();
    unsigned long long mul = 1;
    unsigned long long flag = 1;
    while (!q[i].empty()) {
      node now = q[i].top();
      q[i].pop();
      if (flag == 1) {
        flag = 0;
        unsigned long long ddt = now.d + t;
        if (ddt <= mx) {
          cout << "No" << endl;
          return 0;
        } else {
          if (q[i].size() != 0) {
            arr[op++] = q[i].top().d + t;
          } else {
            arr[op++] = ddt;
          }
        }
      } else {
        if (q[i].size() != 0) {
          arr[op++] = q[i].top().d + t;
        } else {
          arr[op++] = now.d + t + 1;
        }
      }
    }
    mx = arr[op - 1];
  }
  cout << "Yes" << endl;
  for (unsigned long long i = 0; i < op; i++) {
    cout << arr[i] << ' ';
  }
}
