human
At a break Vanya came to the class and saw an array of n k-bit integers a_1, a_2, …, a_n on the board. An integer x is called a k-bit integer if 0 ≤ x ≤ 2^k - 1. 

Of course, Vanya was not able to resist and started changing the numbers written on the board. To ensure that no one will note anything, Vanya allowed himself to make only one type of changes: choose an index of the array i (1 ≤ i ≤ n) and replace the number a_i with the number \overline{a_i}. We define \overline{x} for a k-bit integer x as the k-bit integer such that all its k bits differ from the corresponding bits of x. 

Vanya does not like the number 0. Therefore, he likes such segments [l, r] (1 ≤ l ≤ r ≤ n) such that a_l ⊕ a_{l+1} ⊕ … ⊕ a_r ≠ 0, where ⊕ denotes the [bitwise XOR operation](https://en.wikipedia.org/wiki/Bitwise_operation#XOR). Determine the maximum number of segments he likes Vanya can get applying zero or more operations described above.

Input

The first line of the input contains two integers n and k (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 30).

The next line contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ 2^k - 1), separated by spaces — the array of k-bit integers.

Output

Print one integer — the maximum possible number of segments with XOR not equal to 0 that can be obtained by making several (possibly 0) operations described in the statement.

Examples

Input

3 2
1 3 0

Output

5

Input

6 3
1 4 4 7 3 4

Output

19

Note

In the first example if Vasya does not perform any operations, he gets an array that has 5 segments that Vanya likes. If he performs the operation with i = 2, he gets an array [1, 0, 0], because \overline{3} = 0 when k = 2. This array has 3 segments that Vanya likes. Also, to get an array with 5 segments that Vanya likes, he can perform two operations with i = 3 and with i = 2. He then gets an array [1, 0, 3]. It can be proven that he can't obtain 6 or more segments that he likes.

In the second example, to get 19 segments that Vanya likes, he can perform 4 operations with i = 3, i = 4, i = 5, i = 6 and get an...

Give me a Python code to determine the maximum number of segments he likes Vanya can get applying zero or more operations described above?
assistant
#Here is Python code to determine the maximum number of segments he likes Vanya can get applying zero or more operations described above.

from collections import defaultdict as ddic, deque, Counter
from itertools import combinations, permutations, product
import bisect, heapq
YES, NO = "YES", "NO"

rr = raw_input
rrm = lambda: map(int, rr().split())

def solve(N, K, A):
    def flip(x):
        return (1<<K) - 1 - x
    
    P = [0]
    for x in A:
        P.append(P[-1] ^ x)

    count = Counter(P)
    tot = N*(N+1)/2
    for k in count:
        v = count[k]
        k2 = flip(k)
        if k > k2 and k2 in count: continue
        
        v2 = count.get(k2, 0)
        
        if k != k2:
            vs = v + v2
        else:
            vs = v

        w1 = vs / 2
        w2 = (vs+1) / 2
        tot -= w1 * (w1 - 1) / 2
        tot -= w2 * (w2 - 1) / 2
        
    return tot            

"""
def brute(N, K, A):
    def flip(x):
        return (1<<K) - 1 - x
    def xor(A):
        ans = 0
        for x in A:
            ans ^= x
        return ans

    ans = 0
    for cand in product(*[[x, flip(x)] for x in A]):
        bns = 0
        for i in xrange(len(cand)):
            for j in xrange(i+1,len(cand)+1):
                z = xor(cand[i:j])
                if z != 0:
                    bns += 1
        ans = max(ans, bns)
        
    return ans
"""

N, K = rrm()
print solve(N, K, rrm())