#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long x = 0;
  bool neg = false;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') neg = true, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  if (neg) x = -x;
  return x;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const long long maxn = 3e5, oo = 1e9;
long long n, k, a[maxn + 2], b[maxn + 2], DP[maxn + 2][2];
void input() {
  cin >> n >> k;
  for (long long _b = n, i = 1; i <= _b; ++i) cin >> a[i];
  for (long long _b = n, i = 1; i <= _b; ++i) cin >> b[i];
}
long long get(long long pa, long long pb, long long a, long long b) {
  long long ans = oo;
  if (pa <= k) {
    long long sum = pa + a;
    long long cnt = sum / k - (sum % k == 0);
    if (b == cnt)
      ans = min(ans, sum - cnt * k);
    else if (b > cnt && b <= a * k)
      ans = min(ans, 1ll);
  }
  if (pb <= k) {
    long long cnt = a / k - (a % k == 0);
    if (b == cnt)
      ans = min(ans, a - cnt * k);
    else if (b > cnt && b <= (a - 1) * k + (k - pb))
      ans = min(ans, 1ll);
  }
  return ans;
}
void solve() {
  for (long long _x = n, i = 0; i < _x; ++i) {
    DP[i + 1][0] = get(DP[i][0], DP[i][1], a[i + 1], b[i + 1]);
    DP[i + 1][1] = get(DP[i][1], DP[i][0], b[i + 1], a[i + 1]);
  }
  puts(min(DP[n][0], DP[n][1]) <= k ? "YES" : "NO");
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  input();
  solve();
  return 0;
}
