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;
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll modpow(ll x, ll p, ll mod) {
  x %= mod, (p %= mod - 1) < 0 ? p += mod - 1 : 0LL;
  ll res = 1LL;
  while (p > 0) {
    if (p & 1) res = res * x % mod;
    (x *= x) %= mod, p >>= 1;
  }
  return res;
}
template <int mod>
struct Mint {
  int x;
  Mint(ll x = 0) : x(int((x %= mod) < 0 ? x + mod : x)) {}
  Mint& operator+=(const Mint& rhs) {
    if ((x += rhs.x) >= mod) x -= mod;
    return *this;
  }
  Mint& operator-=(const Mint& rhs) { return *this += mod - rhs.x; }
  Mint& operator*=(const Mint& rhs) {
    x = int((1LL * x * rhs.x) % mod);
    return *this;
  }
  Mint& operator/=(const Mint& rhs) {
    return *this *= Mint(modpow(rhs.x, mod - 2, mod));
  }
  Mint operator+(const Mint& rhs) const { return Mint(*this) += rhs; }
  Mint operator-(const Mint& rhs) const { return Mint(*this) -= rhs; }
  Mint operator*(const Mint& rhs) const { return Mint(*this) *= rhs; }
  Mint operator/(const Mint& rhs) const { return Mint(*this) /= rhs; }
  Mint power(ll p) const { return Mint(modpow(x, p, mod)); }
  bool operator==(const Mint& rhs) const { return x == rhs.x; }
  bool operator<(const Mint& rhs) const { return x < rhs.x; }
  friend ostream& operator<<(ostream& out, const Mint& a) { return out << a.x; }
  friend istream& operator>>(istream& in, Mint& a) {
    ll x;
    in >> x;
    a = Mint(x);
    return in;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  constexpr int mod = 1e9 + 7, N = 20, fullmask = (1 << N) - 1;
  using Mi = Mint<mod>;
  vector<Mi> F(1 << N, 1);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    F[fullmask ^ a] *= Mi(2);
  }
  for (int i = 0; i < N; ++i)
    for (int mask = 0; mask < (1 << N); ++mask)
      if (mask >> i & 1) F[mask] *= F[mask ^ (1 << i)];
  vector<int> sgn(1 << N);
  sgn[0] = (N % 2 ? -1 : +1);
  Mi ans = F[0] * sgn[0];
  for (int mask = 1; mask < (1 << N); ++mask) {
    sgn[mask] = -sgn[mask & (mask - 1)];
    ans += F[mask] * sgn[mask];
  }
  cout << ans << '\n';
  exit(0);
}
