#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
int main() {
  int n;
  ll k;
  cin >> n >> k;
  vector<ll> x(n), y(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) cin >> y[i];
  ll px = 0, py = 0;
  auto calc = [k](int px, int x, int y) {
    ll X = (k - px) + y * k;
    ll Y = (x + 1) * k;
    if (x <= X && y <= Y) {
      ll tmpX = X - x;
      ll tmpY = Y - y;
      if (tmpX < k)
        return make_pair(k - tmpX, INF);
      else if (tmpY < k)
        return make_pair(INF, k - tmpY);
      else
        return make_pair(1LL, 1LL);
    } else
      return make_pair(INF, INF);
  };
  for (int i = 0; i < n; i++) {
    auto tmp0 = calc(px, x[i], y[i]);
    auto tmp1 = calc(py, y[i], x[i]);
    swap(tmp1.first, tmp1.second);
    px = min(tmp0.first, tmp1.first), py = min(tmp0.second, tmp1.second);
  }
  cout << (px <= k || py <= k ? "YES" : "NO") << endl;
  return 0;
}
