#include <bits/stdc++.h>
using namespace std;
const int maxn = 300009;
const int MOD = 1e9 + 7;
long long x[maxn], y[maxn], z[maxn][2];
int main() {
  ;
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  for (int i = 1; i <= n; ++i) cin >> y[i];
  if (k == 1) {
    bool X, Y;
    if (x[1] == y[1])
      X = Y = 1;
    else if (x[1] + 1 == y[1])
      X = 1, Y = 0;
    else if (y[1] + 1 == x[1])
      Y = 1, X = 0;
    else
      X = Y = 0;
    for (int i = 2; i <= n; ++i) {
      if (x[i] == y[i]) {
        ;
      } else if (x[i] + 1 == y[i]) {
        if (Y)
          X = 1, Y = 0;
        else
          X = 0, Y = 0;
      } else if (x[i] == y[i] + 1) {
        if (X)
          Y = 1, X = 0;
        else
          X = 0, Y = 0;
      } else {
        X = 0, Y = 0;
      }
    }
    if (X || Y) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  } else {
    z[0][0] = z[0][1] = 0;
    for (int i = 1; i <= n; ++i) {
      z[i][0] = z[i][1] = k + 1;
      if (z[i - 1][0] <= k) {
        if (x[i] > y[i]) {
          if ((y[i] - 1) * k + (k - z[i - 1][0]) >= x[i]) {
            z[i][1] = z[i][0] = 1;
          } else {
            z[i][0] = min(z[i][0], x[i] - ((y[i] - 1) * k + (k - z[i - 1][0])));
          }
        } else {
          if (x[i] * k >= y[i]) {
            if (z[i - 1][0] == k && y[i] == 1)
              z[i][0] = 1;
            else
              z[i][1] = z[i][0] = 1;
          } else {
            z[i][1] = min(z[i][1], y[i] - x[i] * k);
          }
        }
      }
      if (z[i - 1][1] <= k) {
        if (y[i] > x[i]) {
          if ((x[i] - 1) * k + (k - z[i - 1][1]) >= y[i]) {
            z[i][1] = z[i][0] = 1;
          } else {
            z[i][1] = min(z[i][1], y[i] - ((x[i] - 1) * k + (k - z[i - 1][1])));
          }
        } else {
          if (y[i] * k >= x[i]) {
            if (z[i - 1][1] == k && x[i] == 1)
              z[i][1] = 1;
            else
              z[i][0] = z[i][1] = 1;
          } else {
            z[i][0] = min(z[i][0], x[i] - y[i] * k);
          }
        }
      }
    }
    if (z[n][0] <= k || z[n][1] <= k) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
