#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long ceil(long long a, long long b) { return (a + b - 1) / b; }
array<long long, 2> mend(long long prev, long long X, long long Y,
                         long long K) {
  array<long long, 2> res = {LLONG_MAX, LLONG_MAX};
  if (prev == LLONG_MAX) return res;
  long long amin = ceil(prev + X, K);
  long long amax = 1 + X;
  long long bmin = ceil(Y, K);
  long long bmax = Y;
  {
    long long cmin = max(amin, bmin + 1);
    long long cmax = min(amax, bmax + 1);
    if (cmin <= cmax) {
      res[0] = max(1ll, prev + X - K * (cmax - 1));
    }
  }
  {
    long long cmin = max(amin, bmin);
    long long cmax = min(amax, bmax);
    if (cmin <= cmax) {
      res[1] = max(1ll, Y - K * (cmax - 1));
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);
  int N, K;
  cin >> N >> K;
  vector<int> x(N), y(N);
  for (int i = 0; i < N; i++) cin >> x[i];
  for (int i = 0; i < N; i++) cin >> y[i];
  long long a = 0, b = 0;
  for (int i = 0; i < N; i++) {
    long long as = LLONG_MAX, bs = LLONG_MAX;
    auto r1 = mend(a, x[i], y[i], K);
    as = min(as, r1[0]);
    bs = min(bs, r1[1]);
    auto r2 = mend(b, y[i], x[i], K);
    bs = min(bs, r2[0]);
    as = min(as, r2[1]);
    a = as;
    b = bs;
  }
  if (a < LLONG_MAX || b < LLONG_MAX) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
