#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 5, hgs = 1e9 + 7, K = 19, S = (1 << 20) - 1;
int n, x, f[N], un[N];
void Solution(int Base) {
  for (int k = 0; k <= K; ++k)
    for (int i = 0; i <= S; ++i)
      if (!(i & (1 << k))) f[i] = (f[i] + f[i | (1 << k)] * Base + hgs) % hgs;
}
signed main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &x), ++f[x];
  for (int i = 1; i <= n; ++i) un[i] = (un[i - 1] << 1 | 1) % hgs;
  Solution(1);
  for (int i = 0; i <= S; ++i) f[i] = un[f[i]];
  Solution(-1);
  printf("%d\n", f[0]);
  return 0;
}
