#include <bits/stdc++.h>

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int cnt(int n) {
  int res = 0;
  while(n > 0) {
    res += n % 2;
    n /= 2;
  }
  return res;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  vi v(1<<20);
  for(int i=0;i<n;++i) {
    int a; cin >> a;
    v[a]++;
  }

  for(int i=0;i<20;++i) {
    for(int j=0;j<(1<<20);++j) {
      if((j>>i)&1) {
        v[j-(1<<i)] += v[j];
      }
    }
  }

  vll po(n);
  po[0] = 1;
  for(int i=0;i<n;++i) {
    po[i+1] = po[i] * 2 % MOD;
  }

  ll ans = 0;
  for(int i=0;i<(1<<20);++i) {
    if(cnt(i) % 2 == 0) {
      ans += po[v[i]];
      ans %= MOD;
    } else {
      ans += MOD - po[v[i]];
      ans %= MOD;
    }
  }
  cout << ans << endl;

}

