#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int INF = 0x3f3f3f3f3f, mod = 1e9 + 7, maxn = 3e5 + 100;
const double eps = 1e-6, PI = acos(-1);
template <typename T>
inline void read(T &x) {
  x = 0;
  T f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do x = x * 10 + ch - '0', ch = getchar();
  while (ch <= '9' && ch >= '0');
  x *= f;
}
long long dp[maxn][2];
int n, k, x[maxn], y[maxn];
int calc(int pa, int pb, int a, int b) {
  int ans = INF;
  if (pa <= k) {
    long long cnt = (pa + a - 1) / k;
    if (b == cnt)
      ans = min(ans, pa + a - k * b);
    else if (b > cnt && b <= 1LL * a * k)
      ans = min(ans, 1);
  }
  if (pb <= k) {
    int cnt = (a - 1) / k;
    if (b == cnt)
      ans = min(ans, a - b * k);
    else if (b > cnt && b <= 1LL * (a - 1) * k + 1LL * k - 1LL * pb)
      ans = min(ans, 1);
  }
  return ans;
}
int main() {
  read(n), read(k);
  for (int i = 1; i <= n; i++) read(x[i]);
  for (int i = 1; i <= n; i++) read(y[i]);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 1; j++) dp[i][j] = INF;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = calc(dp[i - 1][0], dp[i - 1][1], x[i], y[i]);
    dp[i][1] = calc(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;
}
