#include <bits/stdc++.h>
const long long INF = 1e18L + 1;
const int IINF = 1e9 + 1;
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
long long n, k;
long long same_ends(long long x0, long long x, long long y) {
  if (y > k * (x - 1) or x + x0 > k * (y + 1)) {
    return IINF;
  } else {
    return max(1ll, x + x0 - k * y);
  }
}
long long diff_ends(long long y0, long long x, long long y) {
  if (y + y0 > k * x or x > k * y) {
    return IINF;
  } else {
    return max(1ll, x - k * y);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  vector<long long> dp_x(n + 1, IINF), dp_y(n + 1, IINF);
  dp_x[0] = 0;
  dp_y[0] = 0;
  vector<long long> x(n + 1), y(n + 1);
  for (long long i = (long long)1; i < (long long)n + 1; i++) {
    cin >> x[i];
  }
  for (long long i = (long long)1; i < (long long)n + 1; i++) {
    cin >> y[i];
  }
  for (long long i = (long long)1; i < (long long)n + 1; i++) {
    if (dp_y[i - 1] != IINF) {
      dp_x[i] = min(dp_x[i], same_ends(0, x[i], y[i]));
      dp_x[i] = min(dp_x[i], diff_ends(dp_y[i - 1], x[i], y[i]));
      dp_y[i] = min(dp_y[i], same_ends(dp_y[i - 1], y[i], x[i]));
      dp_y[i] = min(dp_y[i], diff_ends(0, y[i], x[i]));
    }
    if (dp_x[i - 1] != IINF) {
      dp_x[i] = min(dp_x[i], same_ends(dp_x[i - 1], x[i], y[i]));
      dp_x[i] = min(dp_x[i], diff_ends(0, x[i], y[i]));
      dp_y[i] = min(dp_y[i], same_ends(0, y[i], x[i]));
      dp_y[i] = min(dp_y[i], diff_ends(dp_x[i - 1], y[i], x[i]));
    }
  }
  if (dp_x[n] != IINF or dp_y[n] != IINF) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
