#include <bits/stdc++.h>
using namespace std;
int N, K;
int A[303030], B[303030];
signed long long dp[303030][2];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  scanf("%d%d", &N, &K);
  for (i = 0; i < (N); i++) scanf("%d", &A[i]);
  for (i = 0; i < (N); i++) scanf("%d", &B[i]);
  for (i = 0; i < (N); i++) {
    dp[i + 1][0] = dp[i + 1][1] = K + 1;
    signed long long miT = 1 + (B[i] / K);
    signed long long maT = 1LL * (B[i] + 1) * K;
    signed long long miF = 1 + (B[i] / K);
    signed long long maF = 1LL * (B[i] + 1) * K;
    if (dp[i][0] <= K) {
      x = K - dp[i][0];
      signed long long mi = (B[i] + K - 1) / K;
      signed long long mai = 1LL * (B[i] - 1) * K + x;
      if (A[i] >= mi) dp[i + 1][0] = min(dp[i + 1][0], max(1LL, A[i] - mai));
      mi = (A[i] + dp[i][0] + K - 1) / K;
      mai = 1LL * A[i] * K;
      if (B[i] >= mi) dp[i + 1][1] = min(dp[i + 1][1], max(1LL, B[i] - mai));
    }
    if (dp[i][1] <= K) {
      x = K - dp[i][1];
      signed long long mi = (A[i] + K - 1) / K;
      signed long long mai = 1LL * (A[i] - 1) * K + x;
      if (B[i] >= mi) dp[i + 1][1] = min(dp[i + 1][1], max(1LL, B[i] - mai));
      mi = (B[i] + dp[i][1] + K - 1) / K;
      mai = 1LL * B[i] * K;
      if (A[i] >= mi) dp[i + 1][0] = min(dp[i + 1][0], max(1LL, A[i] - mai));
    }
  }
  if (dp[N][0] > K && dp[N][1] > K)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
