Aftandil has a sequence of integers a_1, a_2, ..., a_n. He decides to divide the sequence into exactly consecutive parts.
The cost of each part is its -sum (bitwise exclusive-), while the cost of the sequence is bitwise -sum of its parts' costs.
Help Aftandil to find the minimum cost of the given sequence.
The first line contains two integers and (1 \le n \le 200{\,}000, 1 \le m \le n).
The second line contains integers a_1, a_2, ..., a_n (0 \le a_i \le 10^9).
Print a single integer that denotes the minimum cost.
Example 1
Example 2