Problems
XOR
XOR
Aftandil has a sequence of integers a1
, a2
, ... , an
. He decides to divide the sequence into exactly m consecutive parts.
The cost of each part is its xor-sum (bitwise exclusive-or), while the cost of the sequence is bitwise or-sum of its parts' costs.
Help Aftandil to find the minimum cost of the given sequence.
Input
The first line contains two integers n and m (1 ≤ n ≤ 200000, 1 ≤ m ≤ n).
The second line contains n integers a1
, a2
, ... , an
(0 ≤ ai
≤ 109
).
Output
Print a single integer that denotes the minimum cost.
Input example #1
3 2 1 3 2
Output example #1
1
Input example #2
4 1 1 2 0 2
Output example #2
1