#include <bits/stdc++.h>
using namespace std;
int dp[300010][2], x[300010][2];
int pa, pb, a, b;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> x[i][0];
  for (int i = 1; i <= n; i++) cin >> x[i][1];
  memset(dp, 0x3f, sizeof dp);
  dp[0][0] = 0, dp[0][1] = 0;
  for (int i = 1; i <= n; i++) {
    for (int f = 0; f < 2; f++) {
      int g = f ^ 1;
      int a = x[i][f], b = x[i][g], pa = dp[i - 1][f], pb = dp[i - 1][g];
      if (pa != 0x3f3f3f3f) {
        int cnt = (pa + a + k - 1) / k - 1, x = (pa + a) % k;
        if (!x) x = k;
        if (b > cnt && b <= 1LL * a * k) dp[i][f] = 1;
        if (b == cnt) dp[i][f] = x;
      }
      if (pb != 0x3f3f3f3f) {
        long long L = (a + k - 1) / k - 1, R = 1LL * (a - 1) * k + (k - pb);
        if (b >= L && b <= R) {
          int x = a % k;
          if (!x) x = k;
          if (b > L)
            dp[i][f] = 1;
          else
            dp[i][f] = x;
        }
      }
    }
    if (dp[i][0] == 0x3f3f3f3f && dp[i][1] == 0x3f3f3f3f) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
