Codeforces Round 257 (Div. 1)
D
Jzzhu and Numbers
Codeforces
2400
原题
← CE →
翻译中…

Jzzhu have $*n*$ non-negative integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$. We will call a sequence of indexes $*i*_{1}, *i*_{2}, ..., *i*_{*k*}$ $(1 ≤ *i*_{1} < *i*_{2} < ... < *i*_{*k*} ≤ *n*)$ a group of size $*k*$.

翻译中…

Jzzhu wonders, how many groups exists such that $*a*_{*i*_{1}}$ & $*a*_{*i*_{2}}$ & ... & $*a*_{*i*_{*k*}} = 0$ $(1 ≤ *k* ≤ *n*)$? Help him and print this number modulo $1000000007$ $(10^{9} + 7)$. Operation $*x*$ & $*y*$ denotes bitwise AND operation of two numbers.

翻译中…

Input

翻译中…

The first line contains a single integer $*n*$ $(1 ≤ *n* ≤ 10^{6})$. The second line contains $*n*$ integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ $(0 ≤ *a*_{*i*} ≤ 10^{6})$.

翻译中…

Output

翻译中…

Output a single integer representing the number of required groups modulo $1000000007$ $(10^{9} + 7)$.

翻译中…

样例

Input #1
3
2 3 3
Output #1
0
InputCopy OutputCopy
Input #2
4
0 1 2 3
Output #2
10
InputCopy OutputCopy
Input #3
6
5 2 0 5 2 1
Output #3
53
InputCopy OutputCopy
题目信息
题号
449D
时间限制
2 s
内存限制
256 MB
标签
位运算
组合数学
动态规划

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。