#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
int n, k, x[N], y[N];
int gao00(long long p, long long c0, long long c1) {
  if (c1 == 0) return c0 <= p ? k - (p - c0) : -1;
  if (c0 == 0) return -1;
  c0 -= max(0ll, min(p, c0 - c1));
  if (c0 <= c1)
    return c0 * k >= c1 ? 1 : -1;
  else
    return c0 - (c1 - 1) * k > k ? -1 : max(1ll, c0 - (c1 - 1) * k);
}
int gao11(long long p, long long c0, long long c1) { return gao00(p, c1, c0); }
int gao01(long long p, long long c0, long long c1) {
  if (c1 == 0) return -1;
  c0 -= max(0ll, min(p, c0 - c1 + 1));
  return gao11(k - 1, c0, c1 - 1);
}
int gao10(long long p, long long c0, long long c1) { return gao01(p, c1, c0); }
int dp[N][2];
void upd(int &dp, int val) {
  if (!~val) return;
  if (!~dp || dp > val) dp = val;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n >> k;
  for (int i = (0); i < (n); ++i) cin >> x[i];
  for (int i = (0); i < (n); ++i) cin >> y[i];
  dp[0][0] = 0;
  dp[0][1] = 0;
  for (int i = (1); i < (n + 1); ++i) fill_n(dp[i], 2, -1);
  for (int i = (0); i < (n); ++i) {
    if (~dp[i][0]) {
      upd(dp[i + 1][0], gao00(k - dp[i][0], x[i], y[i]));
      upd(dp[i + 1][1], gao01(k - dp[i][0], x[i], y[i]));
    }
    if (~dp[i][1]) {
      upd(dp[i + 1][0], gao10(k - dp[i][1], x[i], y[i]));
      upd(dp[i + 1][1], gao11(k - dp[i][1], x[i], y[i]));
    }
  }
  cout << (~dp[n][0] || ~dp[n][1] ? "YES" : "NO");
  return 0;
}
