#Lutece1860. Will the circle be broken

Will the circle be broken

Migrated from Lutece 1860 Will the circle be broken

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

You are given an array AA of NN non-negative integers and an integer MM.

Find the number of pair(i,j)(i,j) such that 1ijN1 \leq i \leq j \leq N and $\min(A_i,A_{i+1},...,A_j) \cdot (A_i \oplus A_{i+1} \oplus ... \oplus A_j ) \leq M$.

Input

The first line contains two integers NN (1N105)(1 \leq N \leq 10^5) and MM (0M1018)(0 \leq M \leq 10^{18}).

The second line contains NN integers representing the elements of AiA_i (1Ai109)(1 \leq A_i \leq 10^9).

Output

Print the corresponding answer in a single line.

Samples

4 2
1 4 772002 200277
1
5 3
1 2 3 2 1
11

Resources

The 16th UESTC Programming Contest Preliminary