#include <bits/stdc++.h>
using namespace std;
int n, k, dp[300010][2];
int x[300010], y[300010];
const int INF = 1e8;
int solve(int pa, int push_back, int a, int b) {
  int ans = INF;
  if (pa <= k) {
    int sep = (pa + a + k - 1) / k - 1;
    if (b == sep) {
      ans = min(ans, pa + a - sep * k);
    } else if (b <= (long long)a * k && b > sep) {
      ans = 1;
    }
  }
  if (push_back <= k) {
    int sep = (a + k - 1) / k - 1;
    if (b == sep) {
      ans = min(ans, a - sep * k);
    } else if (b <= (long long)(a - 1) * k + (k - push_back) && b > sep) {
      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]);
  for (int i = 1; i <= n; i++) {
    dp[i][0] = INF;
    dp[i][1] = INF;
  }
  for (int i = 1; i <= n; i++) {
    dp[i][0] = solve(dp[i - 1][0], dp[i - 1][1], x[i], y[i]);
    dp[i][1] = solve(dp[i - 1][1], dp[i - 1][0], y[i], x[i]);
  }
  if (dp[n][0] <= k || dp[n][1] <= k)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
