#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
const long long N = (long long)3e5 + 7;
long long k, aa[N];
long long get(long long pa, long long pb, long long a, long long b) {
  long long ret = INF;
  if (pa <= k) {
    long long mn = (a + pa + k - 1) / k - 1;
    if (b == mn) ret = min(ret, a + pa - k * mn);
    if (b > mn && b <= a * k) ret = min(ret, 1LL);
  }
  if (pb <= k) {
    long long mn = (a + k - 1) / k - 1;
    if (b == mn) ret = min(ret, a - k * mn);
    if (b > mn && b <= k - pb + (a - 1) * k) ret = min(ret, 1LL);
  }
  return ret;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n >> k;
  long long pa = 0, pb = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> aa[i];
  }
  for (long long i = 1; i <= n; i++) {
    long long b;
    cin >> b;
    long long pa2, pb2;
    pa2 = get(pa, pb, aa[i], b);
    pb2 = get(pb, pa, b, aa[i]);
    pa = pa2;
    pb = pb2;
  }
  cout << ((min(pa, pb) <= k) ? "YES" : "NO") << "\n";
}
