#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double eps = 1e-12;
const int N = 3e5 + 5;
const int mod = 998244353;
int n, k;
int dp[N][2];
int x[N], y[N];
int solve(int prex, int prey, int x, int y) {
  int num, ans = inf;
  if (prex <= k) {
    num = (prex + x - 1) / k;
    if (y == num)
      ans = prex + x - num * k;
    else if (y > num && y <= (long long)x * k)
      ans = 1;
  }
  if (prey <= k) {
    num = (x - 1) / k;
    if (y == num)
      ans = x - num * k;
    else if (y > num && y + prey <= (long long)x * k)
      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] = 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;
}
