#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
int n, k, x[maxn], y[maxn];
int dp[maxn][2];
int ceil(int a, int b) { return a / b + (a % b != 0); }
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);
  memset(dp, 0x3f, sizeof dp);
  dp[0][0] = dp[0][1] = 0;
  for (int i = 1; i <= n; i++) {
    int a = x[i], b = y[i];
    int pa = dp[i - 1][0], pb = dp[i - 1][1];
    int t;
    for (int j = 0; j < 2; j++, swap(a, b), swap(pa, pb)) {
      if (b >= (t = ceil(a + pa, k) - 1) && b <= 1ll * a * k) {
        dp[i][j] = min(
            dp[i][j], (t - b > 0 ? 1 : ((a + pa) % k == 0 ? k : (a + pa) % k)));
      }
      if (b >= (t = ceil(a, k) - 1) && b <= 1ll * (a - 1) * k + k - pb) {
        dp[i][j] = min(dp[i][j], (t - b > 0 ? 1 : (a % k == 0 ? k : a % k)));
      }
    }
  }
  if (dp[n][0] <= k || dp[n][1] <= k) {
    puts("YES");
  } else
    puts("NO");
  return 0;
}
