Rating changes for the last round are temporarily rolled back. They will be returned soon.
×

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

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-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/28/2020 18:44:27 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|