#include <bits/stdc++.h>
using namespace std;
int n;
int k;
int x[300005], y[300005];
int dp[300005][2];
int update(int pa, int pb, int a, int b) {
  int ans = k + 1;
  if (pa <= k) {
    int tot = pa + a;
    int cnt = (tot - 1) / k;
    if (cnt == b) {
      ans = min(ans, tot - b * k);
    } else if (b > cnt && b <= (long long)a * k) {
      ans = min(ans, 1);
    }
  }
  if (pb <= k) {
    int cnt = (a - 1) / k;
    if (cnt == b) {
      ans = min(ans, a - b * k);
    } else if (b > cnt && b + pb <= (long long)a * k) {
      ans = min(ans, 1);
    }
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &y[i]);
  }
  dp[0][0] = dp[0][1] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = update(dp[i - 1][0], dp[i - 1][1], x[i], y[i]);
    dp[i][1] = update(dp[i - 1][1], dp[i - 1][0], y[i], x[i]);
  }
  if (dp[n][0] > k && dp[n][1] > k) {
    puts("NO");
  } else {
    puts("YES");
  }
  return 0;
}
