#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10, INF = 1e9;
int k, a[N], b[N];
int f(int a, int b, int astart, int bstart) {
  int sobra = max(0, a - (k - astart)), cant = (sobra + (k - 1)) / k + 1;
  false && cerr << "f" << '\n';
  false && cerr << a << ' ' << b << ' ' << astart << ' ' << bstart << '\n';
  false && cerr << sobra << ' ' << cant << '\n';
  if (b > (long long)a * k + k - bstart) return INF;
  if (b >= cant)
    return 0;
  else if (b == cant - 1)
    return sobra - (cant - 2) * k;
  else
    return INF;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n >> k;
  for (int i = int(0); i < int(n); i++) cin >> a[i];
  for (int i = int(0); i < int(n); i++) cin >> b[i];
  bool can = true;
  int astart = 0, bstart = 0;
  for (int i = int(0); i < int(n); i++) {
    int na = f(a[i], b[i], astart, bstart), nb = f(b[i], a[i], bstart, astart);
    false && cerr << "res: " << na << ' ' << nb << '\n';
    if (na == INF && nb == INF) {
      can = false;
      break;
    }
    false && cerr << "good" << '\n';
    astart = na;
    bstart = nb;
    false && cerr << "queda " << astart << ' ' << bstart << '\n';
  }
  cout << (can ? "YES" : "NO") << '\n';
  return 0;
}
