#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
const int mod = (1e9) + 7;
const double eps = 1e-10;
const int siz = 3e5 + 5, lg = 25, sq = 355, extrm[2] = {INT_MIN, INT_MAX};
int n, k, cont[siz][2], dp[siz][2];
int cel(int a, int b) { return (a - 1) / b + 1; }
void calc(int cur, int lst, int op) {
  if (dp[cur - 1][lst] == INT_MAX) {
    return;
  }
  int cnt1 = dp[cur - 1][lst] + cont[cur][lst], cnt2 = cont[cur][!lst];
  int c1 = cel(cnt1, k), c2 = cel(cnt2, k);
  if (cnt2 < c1 - 1 || cont[cur][lst] < c2 - 1) {
    return;
  }
  if (cnt2 == c1 - 1) {
    if (op == lst) {
      int val = cnt1 % k;
      val = val != 0 ? val : k;
      dp[cur][op] = min(dp[cur][op], val);
    }
    return;
  }
  if (cont[cur][lst] == c2 - 1) {
    if (op == !lst) {
      int val = cnt2 % k;
      val = val != 0 ? val : k;
      dp[cur][op] = min(dp[cur][op], val);
    }
    return;
  }
  dp[cur][op] = 1;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &cont[i][0]);
    dp[i][0] = dp[i][1] = INT_MAX;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &cont[i][1]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 2; j++) {
      for (int l = 0; l < 2; l++) {
        calc(i, j, l);
      }
    }
  }
  printf("%s\n", (dp[n][0] < INT_MAX || dp[n][1] < INT_MAX ? "YES" : "NO"));
  return 0;
}
