2
1 31
 2
1 0
 10
450661 128600 993228 725823 293549 33490 843121 903634 556169 448234
 1
1
 5
1 3 5 7 9
 6
524 529 5249 524 529 529
 3
1 2 3
 2
0 1
 55
0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 8 9 8 9 9
 16
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
 3
128 1024 2048
 10
3 3 3 5 5 3 3 3 3 5
 1
0
 2
1 2
 2
0 0
 2
1 1

0
 2
 632
 0
 0
 24
 2
 2
 621247139
 64594
 4
 0
 1
 1
 3
 0

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class p0449D {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] line;
		
		line = br.readLine().split(" ");
		int N = Integer.parseInt(line[0]);
		
		line = br.readLine().split(" ");
		int[][] fSub = new int[21][1<<20];
		for(int n=0;n<N;n++){
			fSub[0][Integer.parseInt(line[n])]++;
		}
		
		for(int k = 1; k <= 20; k++){
			for(int x = 0; x < (1<<20); x++){
				fSub[k][x] = fSub[k-1][x];
				if(((x >> (k-1)) & 1) == 0){
					fSub[k][x] += fSub[k-1][x+(1<<(k-1))];
				}
			}
		}
		
		int evenAns = 0;
		int oddAns = 0;
		for(int x = 0; x < (1<<20); x++){
			if((Integer.bitCount(x) & 1) == 0){
				evenAns = (evenAns + (int)pow(2, fSub[20][x])) % 1_000_000_007;
			}
			else{
				oddAns = (oddAns + (int)pow(2, fSub[20][x])) % 1_000_000_007;
			}
		}
		
		System.out.println((evenAns + 1_000_000_007 - oddAns) % 1_000_000_007);
	}
	static long pow(int base, int exp){
		if(exp == 0){
			return 1L;
		}
		long ret = pow(base, exp/2);
		ret = ret * ret % 1_000_000_007;
		if(((exp >> 1) << 1) != exp){
			ret = ret * base % 1_000_000_007;
		}
		return ret;
	}
}
