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;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % p;
    }
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long a, long long p) { return power(a, p - 2, p); }
long long gcd(long long x, long long y) {
  if (x == 0 || y == 0) {
    return max(y, x);
  }
  return gcd(y % x, x);
}
long long a[1 << 17];
long long b[1 << 17];
long long powerb[1 << 17];
long long dp[1 << 17][18];
long long cnt[1 << 17];
int main() {
  long long n;
  scanf("%lld", &n);
  long long maxi = (1 << 17) - 1;
  for (long long i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    a[maxi - x]++;
  }
  for (int i = 0; i < (1 << 17); ++i) b[i] = a[i];
  for (int i = 0; i < 17; ++i)
    for (int mask = 0; mask < (1 << 17); ++mask) {
      if (mask & (1 << i)) b[mask] += b[mask ^ (1 << i)];
    }
  for (long long i = 0; i < (1 << 17); i++) {
    powerb[i] = power(2LL, b[i], 1000000007);
  }
  for (long long mask = 0; mask < (1 << 17); mask++) {
    dp[mask][0] = 0;
    for (long long i = 1; i <= 17; i++) {
      if (mask & (1 << (i - 1)))
        dp[mask][i] = dp[mask][i - 1] + dp[mask ^ (1 << (i - 1))][i - 1];
      else
        dp[mask][i] = dp[mask][i - 1];
      dp[mask][i] %= 1000000007;
    }
    cnt[mask] = powerb[mask] - dp[mask][17];
    cnt[mask] += 1000000007;
    cnt[mask] %= 1000000007;
    dp[mask][0] = cnt[mask];
    for (long long i = 1; i <= 17; i++) {
      if (mask & (1 << (i - 1)))
        dp[mask][i] = dp[mask][i - 1] + dp[mask ^ (1 << (i - 1))][i - 1];
      else
        dp[mask][i] = dp[mask][i - 1];
      dp[mask][i] %= 1000000007;
    }
  }
  cout << cnt[maxi] << endl;
}
