#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
long long n, m, _x, _y, f[300005][2], a[300005], b[300005];
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) b[i] = read();
  for (int i = 1; i <= n; i++) {
    _x = a[i];
    _y = b[i];
    for (int j = 0; j <= 1; j++) {
      long long x = _x, y = _y, t = 1, cnt, s;
      cnt = min(x, y);
      x -= cnt;
      y -= cnt;
      x -= m - f[i - 1][j];
      x -= (cnt - 1) * (m - 1);
      if (x > 0) {
        if (x > m - 1)
          s = inf;
        else
          s = 1 + x;
      } else
        s = 1;
      y -= cnt * (m - 1);
      if (y > 0) s = inf;
      f[i][j] = s;
      x = _x;
      y = _y;
      x--;
      cnt = min(x, y);
      x -= cnt;
      y -= cnt;
      y -= m - f[i - 1][j ^ 1];
      x -= cnt * (m - 1);
      if (x > 0) {
        if (x > m - 1)
          s = inf;
        else
          s = x + 1;
      } else
        s = 1;
      y -= cnt * (m - 1);
      if (y > 0) s = inf;
      f[i][j] = min(f[i][j], s);
      swap(_x, _y);
    }
  }
  if (f[n][0] < inf || f[n][1] < inf)
    puts("YES");
  else
    puts("NO");
  return 0;
}
