#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5, INF = 1e9;
long long dp[N][2], p[N], q[N];
long long n, k;
long long f(long long a, long long b, long long la, long long lb) {
  long long ans = INF;
  if (la <= k) {
    long long c = (a + la - 1) / k;
    if (b <= a * k) {
      if (c == b)
        ans = min(ans, a + la - c * k);
      else if (b > c)
        ans = 1;
    }
  }
  if (lb <= k) {
    long long c = (a - 1) / k;
    if (b <= k - lb + (a - 1) * k) {
      if (c == b)
        ans = min(ans, a - c * k);
      else if (b > c)
        ans = 1;
    }
  }
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (long long i = 0; i < n; i++) {
    cin >> q[i];
  }
  for (long long i = 0; i < n; i++) {
    dp[i + 1][0] = f(p[i], q[i], dp[i][0], dp[i][1]);
    dp[i + 1][1] = f(q[i], p[i], dp[i][1], dp[i][0]);
  }
  if (dp[n][0] <= k || dp[n][1] <= k)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
