#include <bits/stdc++.h>   using namespace std;   int x[200005], y[200005], z[200005];   long long a[200005], b[200005];   int main() {     long long n, t;     cin >> n >> t;     x[0] = 0;     for (int i = 1; i <= n; i++) {       cin >> a[i];       y[i] = 0;     }     for (int i = 1; i <= n; i++) {       cin >> x[i];       y[x[i]]++;       z[x[i]] = i;     }     for (int i = 1; i <= n; i++) {       if ((x[i] < i) || (x[i] < x[i - 1])) {         cout <<  No  << endl;         return 0;       }       if (y[i] > 0 && z[i] != i) {         cout <<  No  << endl;         return 0;       }     }     if (x[n] != n) {       cout <<  No  << endl;       return 0;     }     for (int i = 1; i < n; i++)       if ((a[i + 1] == (a[i] + 1)) && x[i + 1] != x[i] && y[x[i]] > 1) {         cout <<  No  << endl;         return 0;       }     for (int i = 1; i <= n; i++) {       int m = z[i];       if (y[i] == 1)         b[m] = a[m] + t;       else {         for (int j = 0; j < y[i]; j++) b[m - j] = a[m] + t + 1LL - j;       }     }     cout <<  Yes  << endl;     for (int i = 1; i <= n; i++) cout << b[i] <<    ;     cout << endl;     return 0;   }   