#include <bits/stdc++.h>
using namespace std;
const long long N = 6e5 + 5, inf = 1e15 + 7;
long long n, k, id = 0;
long long A[N], B[N], cnt;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, a, b, qq, c, m, d;
  cin >> n >> k;
  for (i = 1; i < n + 1; i++) cin >> A[i];
  for (i = 1; i < n + 1; i++) cin >> B[i];
  for (i = 1; i < n + 1; i++) {
    if (A[i] / k + (A[i] % k != 0) > B[i] + 1 ||
        B[i] / k + (B[i] % k != 0) > A[i] + 1) {
      cout << "NO";
      return 0;
    }
  }
  a = 0;
  b = 0;
  for (i = 1; i < n + 1; i++) {
    c = a;
    d = b;
    A[i] += c;
    if (A[i] / k + (A[i] % k != 0) > B[i] + 1 ||
        B[i] / k + (B[i] % k != 0) > A[i] + 1) {
      cout << "NO";
      return 0;
    }
    if (A[i] / k + (A[i] % k != 0) <= B[i])
      a = 0;
    else {
      a = A[i] % k;
      if (a == 0) a = k;
    }
    A[i] -= c;
    B[i] += d;
    if (A[i] / k + (A[i] % k != 0) > B[i] + 1 ||
        B[i] / k + (B[i] % k != 0) > A[i] + 1) {
      cout << "NO";
      return 0;
    }
    if (B[i] / k + (B[i] % k != 0) <= A[i])
      b = 0;
    else {
      b = B[i] % k;
      if (b == 0) b = k;
    }
    B[i] -= d;
  }
  cout << "YES";
}
