#include <bits/stdc++.h>
using namespace std;
const int MaxN = 3e5 + 1;
int k;
int x[MaxN], y[MaxN];
int dpX[MaxN], dpY[MaxN];
int solve(int prevSame, int prevOther, int same, int other) {
  if (prevSame == -1 && prevOther == -1) return -1;
  if (other == 0) {
    if (prevOther != -1)
      return same;
    else {
      if (prevSame + same <= k)
        return prevSame + same;
      else
        return -1;
    }
  }
  long long lowerBound =
      max(1LL, same - k * 1ll * (other - 1) - (k - prevSame));
  long long upperBound = min((long long)same, (same * 1ll * k - other + k) / k);
  int currentBest = -1;
  if (lowerBound <= upperBound && prevSame != -1 && lowerBound <= k)
    currentBest = (int)lowerBound;
  long long lowerBound2 = max(1LL, same - k * 1ll * other);
  long long upperBound2 =
      min((long long)same, ((k - prevOther) + same * 1ll * k - other) / k);
  if (lowerBound2 <= upperBound2 && prevOther != -1 && lowerBound2 <= k) {
    if (currentBest == -1)
      currentBest = (int)lowerBound2;
    else
      currentBest = min((int)lowerBound2, currentBest);
  }
  return currentBest;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  for (int i = 1; i <= n; ++i) cin >> y[i];
  dpX[0] = 0;
  dpY[0] = 0;
  for (int i = 1; i <= n; ++i) {
    dpX[i] = solve(dpX[i - 1], dpY[i - 1], x[i], y[i]);
    dpY[i] = solve(dpY[i - 1], dpX[i - 1], y[i], x[i]);
  }
  if (dpX[n] != -1 || dpY[n] != -1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
