#include <bits/stdc++.h>
using namespace std;
inline long long min(long long x1, long long x2) { return x1 < x2 ? x1 : x2; }
long long n, k;
long long a[300005], b[300005];
long long dp[300005][2];
long long trans(long long a, long long b, long long pa, long long pb) {
  long long ans = 1e9;
  if (pa <= k) {
    long long cnt = (pa + a + k - 1) / k - 1;
    if (b == cnt) ans = min(ans, pa + a - k * cnt);
    if (b > cnt && b <= a * k) ans = 1;
  }
  if (pb <= k) {
    long long cnt = (a + k - 1) / k - 1;
    if (b == cnt) ans = min(ans, a - k * cnt);
    if (b > cnt && b <= a * k - pb) ans = 1;
  }
  return ans;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    dp[i][0] = trans(a[i], b[i], dp[i - 1][0], dp[i - 1][1]);
    dp[i][1] = trans(b[i], a[i], dp[i - 1][1], dp[i - 1][0]);
  }
  if (dp[n][0] <= k || dp[n][1] <= k)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
