#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];
}
