#include <bits/stdc++.h>
using namespace std;
const int MX = 3e5 + 3;
int n, k, a[MX], b[MX];
void bepok() {
  cout << "NO" << endl;
  exit(0);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  int cnt = k;
  for (int i = 0; i < n; i++) {
    if ((long double)(b[i] - cnt) / (long double)k > a[i]) {
      bepok();
    } else if ((long double)(b[i] - cnt) / (long double)k <= a[i] - 1)
      cnt = k;
    else
      cnt = k - ((b[i] - cnt) - (a[i] - 1) * k);
  }
  cnt = k;
  for (int i = 0; i < n; i++) {
    if ((long double)(a[i] - cnt) / (long double)k > b[i]) {
      bepok();
    } else if ((long double)(a[i] - cnt) / (long double)k <= b[i] - 1)
      cnt = k;
    else {
      cnt = k - (-(b[i] - 1) * k + (a[i] - cnt));
    }
  }
  cout << "YES" << endl;
  return 0;
}
