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 static java.lang.Math.*; 
import java.io.*; 
import java.util.*; 

public class A {
	BufferedReader in; 
	PrintWriter out;
	StringTokenizer st; 


	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(in.readLine());
			} catch(Exception e) {}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next()); 
	}
	public long nextLong() {
		return Long.parseLong(next());
	}

	boolean bit(int m, int i) {
		return (m & (1 << i)) > 0; 
	}

	int n, x, y, c, m, k;  

	long mod = 1000000007L;


	public void run() {
		in  = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		n = nextInt();
		long[] g = new long[1<<20];

		for (int i=0; i<n; i++) {
			g[nextInt()]++;
		}

		long[] f = new long[n+2]; 
		f[1] = 1; 
		for (int i=2; i<=n; i++) f[i] = ((f[i-1] * 2L + 1) % mod);


		for (int i=0; i<20; i++) {
			for (int m=0; m<(1<<20); m++) if (bit(m, i)) g[m ^ (1 << i)]+=g[m];
		}


		long tot=0;
		for (int m=1; m<(1<<20); m++) {
			int cnt = 0;
			for (int i=0; i<20; i++) if (bit(m, i)) cnt++;

			if (cnt % 2 == 0) {
				tot = (tot - f[(int)g[m]] + mod) % mod; 
			} else {
				tot = (tot + f[(int)g[m]]) % mod; 
			}
			//System.err.println(tot);
		}
		
		tot = (f[n] - tot + mod) % mod; 
		out.println(tot);

		out.close(); 
	}

	class Pair implements Comparable<Pair> {
		int x;
		long y; 
		public Pair(int x, long y) {
			this.x=x; 
			this.y=y; 
		}
		public int compareTo(Pair o) {
			if (y != o.y) return sign(y - o.y); 
			return x - o.x; 
		}
	}

	int sign(long x) {
		if (x < 0) return -1; 
		if (x > 0) return 1; 
		return 0;
	}

	public static void main(String[] args) throws Exception {
		new A().run(); 		
	}
}