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.util.Arrays.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	final long MOD = 1000000007;

	long[] two;

	void solve() {
		final int K = 20;
		int n = sc.nextInt();
		int[] a = new int[1 << K];
		for (int i = 0; i < n; i++) {
			++a[sc.nextInt()];
		}
		two = new long[1 << K];
		two[0] = 1;
		for (int i = 1; i < two.length; i++) {
			two[i] = (two[i - 1] << 1);
			if (two[i] >= MOD)
				two[i] -= MOD;
		}
		long res = two[n];

		for (int i = 0; i < K; i++) {
			for (int s = 0; s < 1 << K; s++)
				if ((s >> i & 1) == 0)
					a[s] += a[s | (1 << i)];
		}

		for (int set = 1; set < (1 << K); set++) {
			int on = Integer.bitCount(set);
			int ge = a[set];
			long here = two[ge];
			if (on % 2 == 1) {
				res -= here;
			} else {
				res += here;
			}
		}
		res = (res % MOD + MOD) % MOD;
		System.out.println(res);
	}

	void shuffle(int[] a) {
		int n = a.length;
		Random random = new Random(System.currentTimeMillis());
		for (int i = 0; i < n; i++) {
			int j = i + random.nextInt(n - i);
			int t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
	}

	void print(int[] a) {
		out.print(a[0]);
		for (int i = 1; i < a.length; i++)
			out.print(" " + a[i]);
		out.println();
	}

	static void tr(Object... os) {
		if (LOCAL)
			System.err.println(deepToString(os));
	}

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

	static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
	static String __input = "";

	MyScanner sc = null;
	PrintWriter out = null;

	public void run() throws Exception {
		sc = new MyScanner(System.in);
		out = new PrintWriter(System.out);
		for (; sc.hasNext();) {
			solve();
			out.flush();
		}
		out.close();
	}

	class MyScanner {
		String line;
		BufferedReader reader;
		StringTokenizer tokenizer;

		public MyScanner(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public void eat() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					line = reader.readLine();
					if (line == null) {
						tokenizer = null;
						return;
					}
					tokenizer = new StringTokenizer(line);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
		}

		public String next() {
			eat();
			return tokenizer.nextToken();
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}

		public boolean hasNext() {
			eat();
			return (tokenizer != null && tokenizer.hasMoreElements());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
	}
}
