#include <bits/stdc++.h>
using namespace std;
const int dell[8][2] = {{1, 2},  {1, -2},  {2, 1},  {2, -1},
                        {-1, 2}, {-1, -2}, {-2, 1}, {-2, -1}};
long long mod = 1e9 + 7;
const long long inf = (1LL << 31) - 1;
const int maxn = 3e5 + 7;
const int maxm = 2e7 + 7;
const double eps = 1e-10;
const double pi = acos(-1.0);
const int csize = 22;
int n, m, k, ar[maxn];
long long x[maxn], y[maxn];
int main() {
  long long k;
  scanf("%d", &n);
  scanf("%lld", &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);
  for (int i = 1; i <= n; i++) scanf("%lld", &y[i]);
  long long a = 0, b = 0;
  bool fond = 1;
  for (int i = 1; i <= n; i++) {
    long long na = inf, nb = inf;
    if (x[i] > y[i]) {
      if (b != -1) {
        na = min(na, x[i] - k - (y[i] - 1) * k);
        if (y[i] * k >= x[i]) nb = 1;
      } else if (a != -1) {
        na = min(na, x[i] - (k - a) - (y[i] - 1) * k);
        if (y[i] * k >= x[i] + a) nb = 1;
      }
    } else if (x[i] < y[i]) {
      if (a != -1) {
        nb = min(nb, y[i] - k - (x[i] - 1) * k);
        if (x[i] * k >= y[i]) na = 1;
      } else if (b != -1) {
        nb = min(nb, y[i] - (k - b) - (x[i] - 1) * k);
        if (x[i] * k >= y[i] + b) na = 1;
      }
    } else {
      if (b != -1 || (a != -1 && a != k)) {
        nb = 1;
      }
      if (a != -1 || (b != -1 && b != k)) {
        na = 1;
      }
    }
    a = na > k ? -1 : max(na, 1LL);
    b = nb > k ? -1 : max(nb, 1LL);
    if (a == -1 && b == -1) {
      fond = 0;
      break;
    }
  }
  printf("%s\n", fond ? "YES" : "NO");
  return 0;
}
