#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 70;
int n, k, a[maxn][2];
bool check() {
  int x[2] = {0, 0}, s = 0, l = 1;
  for (int *p = a[0]; p < a[n]; p += 2) {
    if (p[s] > p[l]) swap(s, l);
    int t = (x[s] != -1 ? k : k - x[l]);
    long long d = p[l] - ((long long)(p[s] - 1) * k + t);
    if (d > k)
      return false;
    else if (d <= 0)
      x[l] = x[s] = 1;
    else
      x[s] = -1, x[l] = d;
  }
  return true;
}
int main() {
  while (cin >> n >> k) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i][0]);
    for (int i = 0; i < n; i++) scanf("%d", &a[i][1]);
    if (check())
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
