#include <bits/stdc++.h>
using namespace std;
const int maxn = 300000 + 10;
const int inf = 0x3f3f3f3f;
int n, k, a[maxn], b[maxn], dp[maxn][2];
int get(int x, int y, int a, int b) {
  int ans = inf;
  if (x <= k) {
    int tot = x + a, cnt = (tot - 1) / k;
    if (b == cnt)
      ans = min(ans, tot - cnt * k);
    else if (b > cnt && b <= (long long)a * k)
      ans = min(ans, 1);
  }
  if (y <= k) {
    int cnt = (a - 1) / k;
    if (b == cnt)
      ans = min(ans, a - cnt * k);
    else if (b > cnt && b + y <= (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", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  memset(dp, inf, sizeof(dp));
  dp[0][0] = dp[0][1] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = get(dp[i - 1][0], dp[i - 1][1], a[i], b[i]);
    dp[i][1] = get(dp[i - 1][1], dp[i - 1][0], b[i], a[i]);
  }
  puts((dp[n][0] <= k || dp[n][1] <= k) ? "YES" : "NO");
  return 0;
}
