#Lutece1294. 天行廖的游戏

天行廖的游戏

Migrated from Lutece 1294 天行廖的游戏

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

天行健,君子以自强不息。地势坤,廖爷以厚德载物

一日在喵哈哈村,天行廖和沈宝宝正在玩一个游戏。

天行廖分别在NN个纸片上写上一个数字,并放到一个盒子中。

现在沈宝宝要从盒子中抓出任意张纸片。

如果沈宝宝抓出的纸片上的数字Ai1A_{i1},Ai2A_{i2},....AikA_{ik}满足Ai1A_{i1} & Ai2A_{i2} & ....Aik=0A_{ik} = 0 ( i1<i2<iki_{1} < i_{2} … < i_{k}),那么天行廖赢得这次游戏的胜利,否则沈宝宝赢。

Input

第一行输入11个整数NN。(1N1061 \leq N \leq 10^6)

第二行输入NN个整数A1A2....ANA_1,A_2....A_N。(1Ai1061 \leq A_i \leq 10^6)

Output

输出获胜的方案数量。因为结果可能很大,输出答案对109+710^9+7取模的结果即可。

Samples

3
2 3 3
0
4
0 1 2 3
10
6
5 2 0 5 2 1
53
2
0 0
3

Note

对于第44组样例,三组合法的解是(A1),(A2),(A1,A2)( A_1 ) , ( A_2 ) , ( A_1,A_2 )

Resources

每周一题 Div1