#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007, N = 17;
int n, ans;
int f[200010], g[200010], h[200010], a[200010], c[200010][20], fib[200010],
    cnt[200010], tmp[40];
void update(int &i, int x) { i = (i + x) - (i + x >= mod ? mod : 0); }
int fpow(int i, int j) {
  int ret = 1;
  for (; j; i = (long long)i * i % mod, j /= 2)
    if (j & 1) ret = (long long)ret * i % mod;
  return ret;
}
int main() {
  int i, j, k, x, y;
  fib[0] = 0;
  fib[1] = 1;
  for (i = 2; i <= (1 << N); i++) fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  for (i = 1; i < (1 << N); i++) cnt[i] = cnt[i - (i & (-i))] + 1;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    a[x]++;
  }
  for (i = 0; i < (1 << N); i++) c[i][cnt[i]] = a[i];
  for (i = 0; i < N; i++)
    for (j = 0; j < (1 << N); j++) {
      if (j & (1 << i)) continue;
      for (k = 0; k <= N; k++) update(c[j | (1 << i)][k], c[j][k]);
    }
  for (i = 0; i < (1 << N); i++) {
    memset(tmp, 0, sizeof(tmp));
    for (j = 0; j <= N; j++)
      for (k = 0; j + k <= N; k++)
        update(tmp[j + k], (long long)c[i][j] * c[i][k] % mod);
    for (j = 0; j <= N; j++) c[i][j] = tmp[j];
  }
  for (i = 0; i < N; i++)
    for (j = 0; j < (1 << N); j++) {
      if (j & (1 << i)) continue;
      for (k = 0; k <= N; k++) update(c[j | (1 << i)][k], mod - c[j][k]);
    }
  for (i = 0; i < (1 << N); i++) f[i] = (long long)fib[i] * c[i][cnt[i]] % mod;
  for (i = 0; i < (1 << N); i++) g[i] = a[i];
  for (i = 0; i < N; i++)
    for (j = 0; j < (1 << N); j++) {
      if (j & (1 << i)) continue;
      x = g[j];
      y = g[j | (1 << i)];
      g[j] = (x + y) % mod;
      g[j | (1 << i)] = (x + mod - y) % mod;
    }
  for (i = 0; i < (1 << N); i++) g[i] = (long long)g[i] * g[i] % mod;
  for (i = 0; i < N; i++)
    for (j = 0; j < (1 << N); j++) {
      if (j & (1 << i)) continue;
      x = g[j];
      y = g[j | (1 << i)];
      g[j] = (x + y) % mod;
      g[j | (1 << i)] = (x + mod - y) % mod;
    }
  x = fpow(1 << N, mod - 2);
  for (i = 0; i < (1 << N); i++) g[i] = (long long)g[i] * x % mod;
  for (i = 0; i < (1 << N); i++) g[i] = (long long)fib[i] * g[i] % mod;
  for (i = 0; i < (1 << N); i++) h[i] = (long long)fib[i] * a[i] % mod;
  for (i = 0; i < (1 << (N - 1)); i++) {
    x = i ^ ((1 << N) - 1);
    swap(f[i], f[x]);
    swap(g[i], g[x]);
    swap(h[i], h[x]);
  }
  for (i = 0; i < N; i++)
    for (j = 0; j < (1 << N); j++) {
      if (j & (1 << i)) continue;
      update(f[j | (1 << i)], f[j]);
      update(g[j | (1 << i)], g[j]);
      update(h[j | (1 << i)], h[j]);
    }
  for (i = 0; i < (1 << N); i++)
    f[i] = (long long)f[i] * g[i] % mod * h[i] % mod;
  for (i = 0; i < N; i++)
    for (j = 0; j < (1 << N); j++) {
      if (j & (1 << i)) continue;
      update(f[j | (1 << i)], mod - f[j]);
    }
  for (i = 0; i < (1 << (N - 1)); i++) {
    x = i ^ ((1 << N) - 1);
    swap(f[i], f[x]);
  }
  for (i = 0; i < N; i++) update(ans, f[(1 << i)]);
  printf("%d\n", ans);
  return 0;
}
