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

#include <bits/stdc++.h>
using namespace std;
long long n;
long long mo = 1000000007;
long long dp[(1 << 20) + 5][25];
vector<long long> f, f1, f2;
long long power(long long x, unsigned long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
vector<long long> sos(vector<long long> &v) {
  vector<long long> ans = v;
  for (long long i = 0; i < n; i++) {
    for (long long mask = 0; mask < (1 << n); mask++) {
      if (mask >> i & 1) {
        ans[mask] += ans[mask ^ (1 << i)];
        ans[mask] %= mo;
      }
    }
  }
  return ans;
}
vector<long long> combine(vector<long long> &a) {
  memset(dp, 0, sizeof(dp));
  vector<long long> ans(1 << n, 0);
  for (long long i = 0; i < (1 << n); i++) ans[i] = power(2, a[i], mo);
  for (long long mask = 0; mask < (1 << n); mask++) {
    dp[mask][-1] = 0;
    for (long long i = 0; i < n; i++) {
      dp[mask][i] = dp[mask][i - 1];
      if (mask >> i & 1) {
        dp[mask][i] += dp[mask ^ (1 << i)][i - 1];
        dp[mask][i] %= mo;
      }
    }
    ans[mask] = (ans[mask] - dp[mask][n - 1] + mo) % mo;
    dp[mask][-1] = ans[mask];
    for (long long i = 0; i < n; i++) {
      dp[mask][i] = dp[mask][i - 1];
      if (mask >> i & 1) {
        dp[mask][i] += dp[mask ^ (1 << i)][i - 1];
        dp[mask][i] %= mo;
      }
    }
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long m;
  cin >> m;
  n = 20;
  long long k = (1 << n);
  k--;
  f = f1 = f2 = vector<long long>(1 << n, 0);
  for (long long i = 0; i < m; i++) {
    long long x1;
    cin >> x1;
    x1 ^= k;
    f[x1]++;
  }
  long long req = 0;
  f1 = sos(f);
  f2 = combine(f1);
  cout << f2[k];
}
