Codeforces Round #416 (Div. 2) has been moved to start on 27.05.2017 09:35 (UTC).
×

No tag edit access

D. Jzzhu and Numbers

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputJzzhu 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*_{i1} & *a*_{i2} & ... & *a*_{ik} = 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).

Examples

Input

3

2 3 3

Output

0

Input

4

0 1 2 3

Output

10

Input

6

5 2 0 5 2 1

Output

53

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/27/2017 03:37:04 (p1).

Desktop version, switch to mobile version.
User lists

Name |
---|