#P2275. 异或和

异或和

题目描述

给你一个数列 aa

求出满足$a_l+\cdots +a_r=a_l\operatorname{xor}\cdots\operatorname{xor}a_r,l\le r$ 的 (i,j)(i,j) 的方案数。

输入格式

第一行个一个整数 nn (1n2000001\le n\le 200000)

第二行 nn 个整数 aia_i (0ai<220(1048576)0 \le a_i<2^{20}(1048576))

输出格式

一个整数,代表符合条件的方案数。

样例

4
2 5 4 6
5
9
0 0 0 0 0 0 0 0 0
45
19
885 8 1 128 83 32 256 206 639 16 4 128 689 32 8 64 885 969 1
37