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;
char buf[1 << 21], *p1 = buf, *p2 = buf;
template <class T>
void read(T &x) {
  x = 0;
  int c = getchar();
  int flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
template <class T>
T _max(T a, T b) {
  return b < a ? a : b;
}
template <class T>
T _min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
bool checkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool checkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
const int mod = 1000000000 + 7;
void add(int &a, int b) {
  a += b;
  (a >= mod) && (a -= mod);
}
void sub(int &a, int b) {
  a -= b;
  (a < 0) && (a += mod);
}
void mul(int &a, int b) { a = (long long)a * b % mod; }
int Add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
int Sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
int Mul(int a, int b) { return (long long)a * b % mod; }
int qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (long long)ans * a % mod;
    a = (long long)a * a % mod;
    b >>= 1;
  }
  return ans;
}
int Inv(int a) { return qpow(a, mod - 2); }
const int N = 1000005;
int n;
int a[N], pw2[N];
int b[1 << 20];
void init() {
  read(n);
  pw2[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pw2[i] = Add(pw2[i - 1], pw2[i - 1]);
    read(a[i]);
    ++b[a[i]];
  }
  for (int i = 0; i < 20; ++i) {
    for (int S = (1 << 20) - 1; S >= 0; --S)
      if (!(S >> i & 1)) {
        add(b[S], b[S | (1 << i)]);
      }
  }
  for (int i = 0; i < (1 << 20); ++i) {
    b[i] = pw2[b[i]];
  }
}
void solve() {
  for (int i = 0; i < 20; ++i) {
    for (int S = (1 << 20) - 1; S >= 0; --S)
      if (!(S >> i & 1)) {
        sub(b[S], b[S | (1 << i)]);
      }
  }
  printf("%d\n", b[0]);
}
int main() {
  init();
  solve();
  return 0;
}
