#include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 5;   const long long inf = 3e18;   long long t, a[maxn], b[maxn], x[maxn];   long long l[maxn], r[maxn];   int n;   int main() {     scanf( %d%lld , &n, &t);     for (int i = 1; i <= n; i++) scanf( %lld , a + i);     for (int i = 1; i <= n; i++) scanf( %lld , x + i);     for (int i = 1; i <= n; i++) {       if (i < n && x[i] > x[i + 1]) {         puts( No );         return 0;       }       l[i] = a[i] + t;       r[i] = inf;       if (x[i] < i) {         puts( No );         return 0;       }     }     int now = 1;     for (int i = 1; i < n; i++) {       for (now = max(now, i); now < x[i]; now++) {         l[now] = max(l[now], a[now + 1] + t);       }       if (now != n) r[now] = min(r[now], a[now + 1] + t - 1);     }     for (int i = 1; i <= n; i++) {       if (l[i] > r[i]) {         puts( No );         return 0;       }       b[i] = min(r[i], max(b[i - 1] + 1, l[i]));       if (b[i] <= b[i - 1] || b[i - 1] + 1 > r[i]) {         puts( No );         return 0;       }     }     puts( Yes );     for (int i = 1; i <= n; i++) printf( %lld  , b[i]);     return 0;   }   