#include <bits/stdc++.h>
namespace my_std {
using namespace std;
inline int read() {
  register int ans = 0, f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    f ^= (c == '-');
    c = getchar();
  }
  for (; isdigit(c); c = getchar()) ans = ans * 10 + c - '0';
  return f ? ans : -ans;
}
template <typename _Tp>
inline int chkmin(_Tp &x, _Tp y) {
  return x > y ? x = y, 1 : 0;
}
template <typename _Tp>
inline int chkmax(_Tp &x, _Tp y) {
  return x < y ? x = y, 1 : 0;
}
const int mod = 998244353;
inline void inc(int &x, const int &y) {
  x += y;
  if (x >= mod) x -= mod;
}
inline void dec(int &x, const int &y) {
  x -= y;
  if (x < 0) x += mod;
}
inline int ksm(int x, long long y) {
  int res = 1;
  for (; y; y >>= 1, x = 1ll * x * x % mod)
    if (y & 1) res = 1ll * res * x % mod;
  return res;
}
template <typename _Tp>
inline _Tp gcd(_Tp x, _Tp y) {
  return y ? gcd(y, x % y) : x;
}
}  // namespace my_std
using namespace my_std;
const int N = 500010;
int n, K;
int f[2][N], a[2][N];
inline int upd(const int p, const int x) {
  const int u[2] = {f[x][p], f[x ^ 1][p]};
  const int v[2] = {a[x][p + 1], a[x ^ 1][p + 1]};
  int res = K + 1, cnt;
  if (u[0] <= K) {
    cnt = (u[0] + v[0] - 1) / K;
    if (v[1] == cnt)
      chkmin(res, u[0] + v[0] - cnt * K);
    else if (v[1] > cnt && v[1] <= v[0] * (long long)K)
      chkmin(res, 1);
  }
  if (u[1] <= K) {
    cnt = (v[0] - 1) / K;
    if (v[1] == cnt)
      chkmin(res, v[0] - cnt * K);
    else if (v[1] > cnt && v[1] <= v[0] * (long long)K - u[1])
      chkmin(res, 1);
  }
  return res;
}
int main() {
  n = read(), K = read();
  for (register int i = (1), ed_i = (n); i <= ed_i; ++i)
    a[0][i] = read(), f[0][i] = K + 1;
  for (register int i = (1), ed_i = (n); i <= ed_i; ++i)
    a[1][i] = read(), f[1][i] = K + 1;
  f[0][0] = 0, f[1][0] = 0;
  for (register int i = (1), ed_i = (n); i <= ed_i; ++i) {
    f[0][i] = upd(i - 1, 0);
    f[1][i] = upd(i - 1, 1);
  }
  if (f[0][n] <= K || f[1][n] <= K)
    puts("YES");
  else
    puts("NO");
  return 0;
}
