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;
auto Random_Address = [] {
  char* c;
  c = new char;
  delete c;
  return uint64_t(c);
};
uint64_t const SEED = chrono::steady_clock::now().time_since_epoch().count() *
                      (Random_Address() bitor 1);
mt19937 Rng(SEED);
constexpr int Mask(int i) { return 1 << i; }
constexpr int Getb(int x, int i) { return x >> i bitand 1; }
template <size_t N>
bitset<N> Bits(int x) {
  return bitset<N>(x);
}
template <class X, class Y>
bool minimize(X& x, Y const& y) {
  return y < x ? x = y, 1 : 0;
}
template <class X, class Y>
bool maximize(X& x, Y const& y) {
  return y > x ? x = y, 1 : 0;
}
int constexpr maxN = 1e6, mod_ = 1e9 + 7, maxA = 1e6;
int constexpr maxB = 20;
int N;
int a[maxN + 3];
int f[Mask(maxB) + 3];
int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
    ++f[a[i]];
  }
  for (int j = 0; j < maxB; j++)
    for (int i = Mask(maxB) - 1; i >= 0; i--)
      if (Getb(i, j)) f[i xor Mask(j)] += f[i];
  auto Add = [](int& x, int const& y) {
    x += y;
    if (x >= mod_) x -= mod_;
    return;
  };
  auto Sub = [](int& x, int const& y) {
    x -= y;
    if (x < 0) x += mod_;
    return;
  };
  auto Mul = [](int const& x, int const& y) {
    return static_cast<int>(static_cast<int64_t>(x) * y % mod_);
  };
  auto Pow = [](int x, int y) {
    int res = 1;
    for (; y; y >>= 1, x = static_cast<int64_t>(x) * x % mod_)
      if (y bitand 1) res = static_cast<int64_t>(res) * x % mod_;
    return res;
  };
  int res = 0;
  for (int i = 0; i < Mask(maxB); i++)
    if (__builtin_popcount(i) bitand 1)
      Sub(res, Pow(2, f[i]));
    else
      Add(res, Pow(2, f[i]));
  cout << res;
  return 0;
}
