#include <bits/stdc++.h>
using namespace std;
const long long maxn = 300300, inf = 10000000;
long long n, k, ab[maxn][2], dp[maxn][2];
signed main() {
  scanf("%lld%lld", &n, &k);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &ab[i][0]);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &ab[i][1]);
  memset(dp, 0x3f, sizeof dp);
  dp[0][0] = dp[0][1] = 0;
  for (long long i = 0; i < n; ++i) {
    for (long long c = 0; c <= 1; ++c) {
      long long p = dp[i][c], a = ab[i + 1][c], b = ab[i + 1][c ^ 1];
      long long cnt = (b - 1) / k + 1;
      if (p > k) continue;
      if (!(a < cnt || a > k - p + b * k))
        dp[i + 1][c] = min(dp[i + 1][c], max(1LL, a + p - b * k));
      if (!(a < cnt - 1 || a > b * k - p)) {
        if (a == cnt - 1)
          dp[i + 1][c ^ 1] = min(dp[i + 1][c ^ 1], b - (cnt - 1) * k);
        else
          dp[i + 1][c ^ 1] = 1;
      }
    }
  }
  if (min(dp[n][0], dp[n][1]) > inf)
    puts("NO");
  else
    puts("YES");
  return 0;
}
