Problems
One more problem with XOR
One more problem with XOR
Given array A with n nonegative integers, find the amount of pairs of numbers 1 ≤ l ≤ r ≤ n such that X ≤ Al
xor Al+1
xor ... xor Ar
for some given integer X. xor is operation of bit addition (in binary) by modulo two. The result of this operation is one if the bits of operands are different. For example: 1010
xor 2310
= 2910
, 10102
xor 101112
= 111012
, here given an equation in binary and then in decimal notation.
Input
First line contains two integers n (1 ≤ n ≤ 105
) and X (0 ≤ X ≤ 109
). Next line contains n integers. Each number is no more than 109
.
Output
Print one number - the answer to the problem.
Input example #1
5 0 1 2 3 4 5
Output example #1
15
Input example #2
3 3 1 2 3
Output example #2
2