Vova has taken his summer practice this year and now he should write a report on how it went.

Vova has already drawn all the tables and wrote down all the formulas. Moreover, he has already decided that the report will consist of exactly n pages and the i-th page will include x_i tables and y_i formulas. The pages are numbered from 1 to n.

Vova fills the pages one after another, he can't go filling page i + 1 before finishing page i and he can't skip pages. 

However, if he draws strictly more than k tables in a row or writes strictly more than k formulas in a row then he will get bored. Vova wants to rearrange tables and formulas in each page in such a way that he doesn't get bored in the process. Vova can't move some table or some formula to another page.

Note that the count doesn't reset on the start of the new page. For example, if the page ends with 3 tables and the next page starts with 5 tables, then it's counted as 8 tables in a row.

Help Vova to determine if he can rearrange tables and formulas on each page in such a way that there is no more than k tables in a row and no more than k formulas in a row.

Input

The first line contains two integers n and k (1 ≤ n ≤ 3 ⋅ 10^5, 1 ≤ k ≤ 10^6).

The second line contains n integers x_1, x_2, ..., x_n (1 ≤ x_i ≤ 10^6) — the number of tables on the i-th page.

The third line contains n integers y_1, y_2, ..., y_n (1 ≤ y_i ≤ 10^6) — the number of formulas on the i-th page.

Output

Print "YES" if Vova can rearrange tables and formulas on each page in such a way that there is no more than k tables in a row and no more than k formulas in a row.

Otherwise print "NO".

Examples

Input


2 2
5 5
2 2


Output


YES


Input


2 2
5 6
2 2


Output


NO


Input


4 1
4 1 10 1
3 2 10 1


Output


YES

Note

In the first example the only option to rearrange everything is the following (let table be 'T' and formula be 'F'): 

  * page 1: "TTFTTFT" 
  * page 2: "TFTTFTT" 



That way all blocks of tables have length 2.

In the second example there is no way to fit everything in such a way that there are no more than 2 tables in a row and 2 formulas in a row.
#include <bits/stdc++.h>
using namespace std;
long long int cons;
inline long long int check(long long int a) {
  if (a >= cons) a %= cons;
  return a;
}
inline long long int check2(long long int a) {
  a %= cons;
  if (a < 0) a += cons;
  return a;
}
inline long long int fast_check(long long int a) {
  if (a >= cons) a -= cons;
  return a;
}
long long int GCD(long long int a, long long int b) {
  while (a && b) {
    a = a % b;
    if (a != 0) b = b % a;
  }
  return a + b;
}
long long int exp(long long int a, long long int n) {
  long long int ans = 1;
  a = check(a);
  while (n) {
    if (n & 1) ans = check(ans * a);
    a = check(a * a);
    n = (n >> 1);
  }
  return ans;
}
void print_pair(pair<int, int> p) {
  cout << p.first << " " << p.second << endl;
}
long long int nc2(long long int a) { return (a * (a - 1)) / 2; }
long long int nc3(long long int a) {
  long long int b = a * (a - 1) * (a - 2);
  return b / 6;
}
const int N = 3e5 + 1;
long long int previ[N][2];
bool flag[N][2];
long long int zero[N];
long long int one[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cons = 1e9 + 7;
  srand(time(NULL));
  flag[0][0] = flag[0][1] = true;
  long long int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) previ[i][0] = previ[i][1] = 1e9;
  for (int i = 1; i <= n; i++) cin >> zero[i];
  for (int i = 1; i <= n; i++) cin >> one[i];
  long long int arr[2];
  for (int i = 1; i <= n; i++) {
    arr[0] = zero[i];
    arr[1] = one[i];
    for (int j = 0; j < 2; j++) {
      if (!flag[i - 1][j]) continue;
      if (arr[1 - j] > arr[j]) {
        long long int temp = arr[1 - j] - arr[j] * k;
        if (temp > k) continue;
        flag[i][1 - j] = true;
        previ[i][1 - j] = min(previ[i][1 - j], max((long long int)1, temp));
        if (temp <= 0) {
          flag[i][j] = true;
          previ[i][j] = 1;
        }
      } else {
        long long int temp = arr[j] + previ[i - 1][j] - arr[1 - j] * k;
        if (temp > k) continue;
        flag[i][j] = true;
        previ[i][j] = min(previ[i][j], max((long long int)1, temp));
        if (temp <= 0) {
          flag[i][1 - j] = true;
          previ[i][1 - j] = 1;
        }
      }
    }
  }
  if (flag[n][0] || flag[n][1])
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
