#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const long long maxn = 3e5 + 530;
const long long mod = 998244353;
const long long base = 1e9;
long long dp[maxn];
long long dp1[maxn];
long long x[maxn];
long long y[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("t.inp", "r")) {
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
  }
  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) {
    long long th = 0;
    for (int i = 1; i <= n; i++) {
      if (abs(x[i] - y[i]) >= 2) {
        cout << "NO";
        return 0;
      }
      if (th == 0) {
        if (x[i] == y[i]) {
          th = 0;
        } else if (x[i] > y[i]) {
          th = 1;
        } else {
          th = 2;
        }
      } else if (th == 1) {
        if (x[i] == y[i]) {
          th = 1;
        } else if (x[i] > y[i]) {
          cout << "NO";
          return 0;
        } else {
          th = 2;
        }
      } else {
        if (x[i] == y[i]) {
          th = 2;
        } else if (x[i] < y[i]) {
          cout << "NO";
          return 0;
        } else {
          th = 1;
        }
      }
    }
    cout << "YES";
    return 0;
  }
  dp[0] = 0;
  dp1[0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = base;
    dp1[i] = base;
    if (dp[i - 1] <= k) {
      if (y[i] >= x[i]) {
        if ((x[i] + 1) * k >= y[i]) {
          long long cl = (x[i] + 1) * k - y[i];
          if (cl >= k) {
            dp[i] = min(dp[i], 1ll);
            if (y[i] != 1 || (y[i] == 1 && dp[i - 1] != k))
              dp1[i] = min(dp1[i], 1ll);
          } else {
            dp1[i] = min(dp1[i], k - cl);
          }
        }
      } else {
        if (k - dp[i - 1] >= x[i]) {
          dp[i] = min(dp[i], 1ll);
          dp1[i] = min(dp1[i], 1ll);
        } else {
          long long du = min(k - dp[i - 1], x[i] - y[i]);
          long long t = x[i];
          x[i] -= du;
          if ((y[i]) * k >= x[i]) {
            long long cl = (y[i]) * k - x[i];
            if (cl >= k) {
              dp[i] = min(dp[i], 1ll);
              dp1[i] = min(dp1[i], 1ll);
            } else {
              dp[i] = min(dp[i], k - cl);
            }
          }
          x[i] = t;
        }
      }
    }
    if (dp1[i - 1] <= k) {
      if (x[i] >= y[i]) {
        if ((y[i] + 1) * k >= x[i]) {
          long long cl = (y[i] + 1) * k - x[i];
          if (cl >= k) {
            if (x[i] != 1 || (x[i] == 1 && dp1[i - 1] != k))
              dp[i] = min(dp[i], 1ll);
            dp1[i] = min(dp1[i], 1ll);
          } else {
            dp[i] = min(dp[i], k - cl);
          }
        }
      } else {
        if (k - dp1[i - 1] >= y[i]) {
          dp[i] = min(dp[i], 1ll);
          dp1[i] = min(dp1[i], 1ll);
        } else {
          long long du = min(k - dp1[i - 1], y[i] - x[i]);
          long long t = y[i];
          y[i] -= du;
          if ((x[i]) * k >= y[i]) {
            long long cl = (x[i]) * k - y[i];
            if (cl >= k) {
              dp[i] = min(dp[i], 1ll);
              dp1[i] = min(dp1[i], 1ll);
            } else {
              dp1[i] = min(dp1[i], k - cl);
            }
          }
          y[i] = t;
        }
      }
    }
  }
  if (dp[n] <= k || dp1[n] <= k) {
    cout << "YES";
    return 0;
  } else {
    cout << "NO";
  }
}
