#include <bits/stdc++.h>
using namespace std;
long long n, K, dp[300010][2];
long long getans(long long x, long long y, long long a, long long b) {
  long long res = 1e18;
  if (x <= K) {
    long long t = (x + a + (K - 1)) / K;
    t--;
    if (b == t) {
      res = min(res, a + x - (K * t));
    } else if (b > t && a * K >= b)
      res = min(res, 1LL);
  }
  if (y <= K) {
    long long t = (a + K - 1) / K;
    t--;
    if (b == t) {
      res = min(res, a - K * t);
    } else if (b > t && (a - 1) * K + (K - y) >= b)
      res = min(res, 1LL);
  }
  return res;
}
long long x[300010], y[300010];
signed main() {
  scanf("%lld%lld", &n, &K);
  for (long long i = 1; i <= n; i++) scanf("%lld", &x[i]);
  for (long long i = 1; i <= n; i++) scanf("%lld", &y[i]);
  dp[0][0] = 0;
  dp[0][1] = 0;
  for (long long i = 1; i <= n; i++) {
    dp[i][0] = getans(dp[i - 1][0], dp[i - 1][1], x[i], y[i]);
    dp[i][1] = getans(dp[i - 1][1], dp[i - 1][0], y[i], x[i]);
  }
  if (dp[n][0] <= K || dp[n][1] <= K)
    puts("YES");
  else
    puts("NO");
  return 0;
}
