#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
const long long N = 3e5 + 5;
long long s[N][2];
long long f[N][2];
long long x[N];
long long y[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; ++i) cin >> x[i];
  for (long long i = 0; i < n; ++i) cin >> y[i];
  f[0][0] = f[0][1] = 0;
  for (long long i = 0; i < 2; i++) f[0][i] = 0;
  for (long long i = 0; i < n; ++i) {
    if (y[i] > (x[i] + 1) * k) return 0 * puts("NO");
    if (x[i] > (y[i] + 1) * k) return 0 * puts("NO");
    f[i + 1][0] = f[i + 1][1] = -1;
    long long can[] = {k, k};
    if (f[i][1] < 0) can[0] = k - f[i][0];
    if (f[i][0] < 0) can[1] = k - f[i][1];
    for (long long p = 0; p < 2; ++p) {
      if (y[i] >= x[i]) {
        if (y[i] <= (x[i] - 1) * k + can[p ^ 1]) f[i + 1][p] = 1;
      } else {
        if (!y[i]) {
          if (x[i] <= can[p]) f[i + 1][p] = k - can[p] + x[i];
        } else if (x[i] <= y[i] * k + can[p])
          f[i + 1][p] = max(1ll, x[i] - can[p] - (y[i] - 1) * k);
      }
      swap(x[i], y[i]);
    }
    if (f[i + 1][0] < 0 && f[i + 1][1] < 0) return 0 * puts("NO");
  }
  puts("YES");
}
