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