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>
inline int sbt(int x) { return __builtin_popcount(x); }
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
inline int mul(int a, int b, int m = 1000000007) { return (a * b) % m; }
inline int add(int a, int b, int m = 1000000007) { return (a + b) % m; }
inline int sub(int a, int b, int m = 1000000007) { return (a - b + m) % m; }
int fastpow(int a, int b) {
  int res = 1ll;
  while (b > 0) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
int n, q, dp[2000013], max_bits = 20;
int32_t main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    dp[x]++;
  }
  for (int bit = 0; bit < max_bits; bit++)
    for (int mask = 0; mask < (1 << max_bits); mask++)
      if (mask & (1 << bit)) dp[mask ^ (1 << bit)] += dp[mask];
  int res = sub(fastpow(2, n), 1);
  for (int mask = 1; mask < (1 << max_bits); mask++) {
    if (sbt(mask) & 1)
      res = sub(res, sub(fastpow(2, dp[mask]), 1));
    else
      res = add(res, sub(fastpow(2, dp[mask]), 1));
  }
  cout << res;
  return 0;
}
