#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  vector<int> zero(n + 1), one(n + 1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &zero[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &one[i]);
  }
  vector<vector<int>> dp(n + 1, vector<int>(2, -1));
  dp[0][0] = dp[0][1] = 1;
  for (int i = 1; i <= n; i++) {
    int x = min(one[i], zero[i]);
    if (x * 1LL * k >= one[i]) {
      if (zero[i] <= one[i]) {
        int top1 = 0;
        if (dp[i - 1][0] != -1) {
          top1 = k;
        }
        if (dp[i - 1][1] != -1) {
          top1 = max(top1, k - dp[i - 1][1]);
        }
        if (top1 + (x - 1) * 1LL * k >= one[i]) {
          dp[i][0] = 1;
        }
      } else {
        int top0 = 0;
        if (dp[i - 1][1] != -1) {
          top0 = k;
        }
        if (dp[i - 1][0] != -1) {
          top0 = max(top0, k - dp[i - 1][0]);
        }
        int rem = max(zero[i] - top0 - (x - 1) * 1LL * k - 1, 0LL);
        if (rem <= k - 1) {
          dp[i][0] = 1 + rem;
        }
      }
    }
    if (x * 1LL * k >= zero[i]) {
      if (one[i] <= zero[i]) {
        int top0 = 0;
        if (dp[i - 1][1] != -1) {
          top0 = k;
        }
        if (dp[i - 1][0] != -1) {
          top0 = max(top0, k - dp[i - 1][0]);
        }
        if (top0 + (x - 1) * 1LL * k >= zero[i]) {
          dp[i][1] = 1;
        }
      } else {
        int top1 = 0;
        if (dp[i - 1][0] != -1) {
          top1 = k;
        }
        if (dp[i - 1][1] != -1) {
          top1 = max(top1, k - dp[i - 1][1]);
        }
        int rem = max(one[i] - top1 - (x - 1) * 1LL * k - 1, 0LL);
        if (rem <= k - 1) {
          dp[i][1] = 1 + rem;
        }
      }
    }
    if (dp[i][0] == -1 && dp[i][1] == -1) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
}
