#include <bits/stdc++.h>
using namespace std;
long long dp[300005][2];
long long x[300005], y[300005];
long long n, k;
long long solve(long long pt, long long pf, long long ct, long long cf) {
  long long ret = 1e9;
  if (pt <= k) {
    long long minf = (pt + ct + k - 1) / k - 1;
    long long maxf = ct * k;
    if (cf == minf)
      ret = min(ret, pt + ct - minf * k);
    else if (minf < cf && cf <= maxf)
      ret = min(ret, (long long)1);
  }
  if (pf <= k) {
    long long minf = (ct + k - 1) / k - 1;
    long long maxf = (ct - 1) * k + k - pf;
    if (cf == minf)
      ret = min(ret, ct - cf * k);
    else if (minf < cf && cf <= maxf)
      ret = min(ret, (long long)1);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= n; i++) cin >> y[i];
  dp[0][0] = 0, dp[0][1] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = solve(dp[i - 1][0], dp[i - 1][1], x[i], y[i]);
    dp[i][1] = solve(dp[i - 1][1], dp[i - 1][0], y[i], x[i]);
  }
  if (dp[n][0] <= k || dp[n][1] <= k)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
