#include <bits/stdc++.h>
using namespace std;
template <class T>
using VV = vector<vector<T>>;
template <class T>
inline T SMIN(T& a, const T b) {
  return a = (a > b) ? b : a;
}
template <class T>
inline T SMAX(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <class Iter>
void dumpc(Iter begin, Iter end) {
  if (false) {
    for (; begin != end; ++begin) {
      cerr << *begin << ',';
    }
    cerr << endl;
  }
}
const int MAX_N = 3e5 + 1;
long long X[MAX_N][2];
int N;
long long K;
const long long Inf = 1e7;
long long dp[MAX_N][2];
void solve() {
  for (int i = 0; i <= (N); ++i)
    for (int c = 0; c < (2); ++c) dp[i][c] = Inf;
  dp[0][0] = dp[0][1] = 0;
  for (int i = 0; i < (N); ++i)
    for (int c = 0; c < (2); ++c) {
      if (dp[i][c] <= K) {
        long long tot = dp[i][c] + X[i][c];
        long long minsep = (tot + K - 1) / K - 1;
        if (X[i][1 - c] == minsep) {
          SMIN(dp[i + 1][c], tot - K * X[i][1 - c]);
        } else if (X[i][1 - c] > minsep && X[i][1 - c] <= K * X[i][c]) {
          SMIN(dp[i + 1][c], 1LL);
        }
      }
      if (dp[i][1 - c] <= K) {
        long long minsep = (X[i][c] + K - 1) / K - 1;
        if (X[i][1 - c] == minsep) {
          SMIN(dp[i + 1][c], X[i][c] - K * X[i][1 - c]);
        } else if (X[i][1 - c] > minsep &&
                   X[i][1 - c] <= K - dp[i][1 - c] + (X[i][c] - 1) * K) {
          SMIN(dp[i + 1][c], 1LL);
        }
      }
    }
  if (dp[N][0] <= K || dp[N][1] <= K)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
void solve_wrong2() {
  for (int i = 0; i <= (N); ++i)
    for (int c = 0; c < (2); ++c) dp[i][c] = Inf;
  dp[0][0] = dp[0][1] = 0;
  for (int i = 0; i < (N); ++i)
    for (int c = 0; c < (2); ++c)
      if (X[i][c] >= X[i][1 - c]) {
        if (dp[i][c] <= K) {
          long long rem =
              max(X[i][c] - (K - dp[i][c]) - K * (X[i][1 - c] - 1), 0LL);
          if (false) {
            cerr << "i"
                 << " = " << (i) << ", "
                 << "c"
                 << " = " << (c) << ", "
                 << "dp[i][c]"
                 << " = " << (dp[i][c]) << ", "
                 << "rem"
                 << " = " << (rem) << endl;
          };
          if (rem == 1) {
            SMIN(dp[i + 1][c], 1LL);
            dp[i + 1][1 - c] = 0;
          } else if (rem == 0) {
            dp[i + 1][c] = 0;
            dp[i + 1][1 - c] =
                X[i][1 - c] == X[i][c] && (K == 1 || X[i][1 - c] == 1) ? 1 : 0;
          } else {
            SMIN(dp[i + 1][c], rem);
            if (rem <= K) dp[i + 1][1 - c] = 0;
          }
        }
      }
  if (false) {
    cerr << "dp[N][0]"
         << " = " << (dp[N][0]) << ", "
         << "dp[N][1]"
         << " = " << (dp[N][1]) << endl;
  };
  if (dp[N][0] <= K || dp[N][1] <= K)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
void solve_wrong() {
  for (int i = 0; i <= (N); ++i)
    for (int c = 0; c < (2); ++c) dp[i][c] = Inf;
  dp[0][0] = dp[0][1] = 0;
  for (int i = 0; i < (N); ++i)
    for (int c = 0; c < (2); ++c) {
      long long cycle = min(X[i][c] / K, X[i][1 - c] / K);
      long long rem[2] = {};
      rem[c] = X[i][c] - K * cycle, rem[1 - c] = X[i][1 - c] - K * cycle;
      if (dp[i][c] <= K) {
        if (false) {
          cerr << "i"
               << " = " << (i) << ", "
               << "c"
               << " = " << (c) << ", "
               << "cycle"
               << " = " << (cycle) << ", "
               << "dp[i][c]"
               << " = " << (dp[i][c]) << endl;
        };
        long long a = rem[c] - (K - dp[i][c]);
        if (a <= 0)
          SMIN(dp[i + 1][1 - c], rem[1 - c]);
        else if (rem[1 - c] <= K)
          SMIN(dp[i + 1][c], a);
        else if (a <= K)
          SMIN(dp[i + 1][1 - c], rem[1 - c] - K);
        if (rem[1 - c] <= K)
          SMIN(dp[i + 1][c], rem[c]);
        else if (rem[c] <= K)
          SMIN(dp[i + 1][1 - c], rem[1 - c] - K);
      }
    }
  if (false) {
    cerr << "dp[N][0]"
         << " = " << (dp[N][0]) << ", "
         << "dp[N][1]"
         << " = " << (dp[N][1]) << endl;
  };
  if (dp[N][0] <= K || dp[N][1] <= K)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> K;
  for (int i = 0; i < (N); ++i) cin >> X[i][0];
  for (int i = 0; i < (N); ++i) cin >> X[i][1];
  solve();
  return 0;
}
