#abc245c. [abc245_c]Choose Elements

[abc245_c]Choose Elements

Problem Statement

You are given two sequences, each of length NN, consisting of integers: A=(A1,ldots,AN)A=(A_1, \\ldots, A_N) and B=(B1,ldots,BN)B=(B_1, \\ldots, B_N).

Determine whether there is a sequence of length NN, X=(X1,ldots,XN)X=(X_1, \\ldots, X_N), satisfying all of the conditions below.

  • Xi=AiX_i = A_i or Xi=BiX_i = B_i, for every i(1leqileqN)i(1\\leq i\\leq N).

  • XiXi+1leqK|X_i - X_{i+1}| \\leq K, for every i(1leqileqN1)i(1\\leq i\\leq N-1).

Constraints

  • 1leqNleq2times1051 \\leq N \\leq 2\\times 10^5
  • 0leqKleq1090 \\leq K \\leq 10^9
  • 1leqAi,Bileq1091 \\leq A_i,B_i \\leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK A1A_1 ldots\\ldots ANA_N B1B_1 ldots\\ldots BNB_N

Output

If there is an XX that satisfies all of the conditions, print Yes; otherwise, print No.


Sample Input 1

5 4
9 8 3 7 2
1 6 2 9 5

Sample Output 1

Yes

X=(9,6,3,7,5)X=(9,6,3,7,5) satisfies all conditions.


Sample Input 2

4 90
1 1 1 100
1 2 3 100

Sample Output 2

No

No XX satisfies all conditions.


Sample Input 3

4 1000000000
1 1 1000000000 1000000000
1 1000000000 1 1000000000

Sample Output 3

Yes