#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:500000000")
using namespace std;
const int mod = 1000000007;
int a[(1 << 20)], t2[(1 << 20) + 1], bitCount[(1 << 20)], c[(1 << 20)];
int main() {
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    c[a[i]]++;
  }
  t2[0] = 1;
  for (i = 1; i <= (1 << 20); i++) t2[i] = t2[i - 1] * 2 % mod;
  bitCount[1] = 1;
  for (i = 2; i < (1 << 20); i++) bitCount[i] = bitCount[i / 2] + (i & 1);
  for (int bit = 20 - 1; bit >= 0; bit--)
    for (int mask = 0; mask < (1 << 20); mask++)
      if (mask & (1 << bit)) c[mask ^ (1 << bit)] += c[mask];
  long long res = (t2[n] - 1 + mod) % mod;
  for (int mask = 1; mask < (1 << 20); mask++) {
    if (bitCount[mask] & 1)
      res = (res - (t2[c[mask]] - 1) + mod) % mod;
    else
      res = (res + (t2[c[mask]] - 1) + mod) % mod;
  }
  cout << res << endl;
}
