#include <bits/stdc++.h>
using namespace std;
const int L = 17;
const int N = 1 << 17;
const int md = 1e9 + 7;
const int rN = 742744451;
void amod(int &x) {
  while (x >= md) x -= md;
  while (x < 0) x += md;
}
void aconv(int n, int *u, int *v, int *w, int *x) {
  if (n <= 32) {
    for (int i = 0; i < n; ++i) w[i] = 0;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) amod(w[i & j] += 1ll * u[i] * v[j] % md);
    return;
  }
  int m = n >> 1;
  aconv(m, u + m, v + m, w + m, x);
  for (int i = 0; i < m; ++i) {
    amod(x[i] = u[i] + u[m + i]);
    amod(x[m + i] = v[i] + v[m + i]);
  }
  aconv(m, x, x + m, w, x + n);
  for (int i = 0; i < m; ++i) amod(w[i] -= w[m + i]);
}
int ab[N], c[N], de[N], f[N];
int d[N], bf[N + N];
int main() {
  f[1] = 1;
  for (int i = 2; i < N; ++i) amod(f[i] = f[i - 1] + f[i - 2]);
  int n, x, y;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    ++c[x];
  }
  for (int m = 0; m < N; ++m) {
    for (int s = m;; s = (s - 1) & m) {
      amod(ab[m] += 1ll * c[s] * c[m ^ s] % md);
      if (s == 0) break;
    }
  }
  for (int i = 0; i < N; ++i) de[i] = c[i];
  for (int i = 0; i < L; ++i) {
    for (int m = 0, s; m < N; ++m) {
      if (m >> i & 1) continue;
      s = m ^ (1 << i);
      amod(x = de[m] + de[s]);
      amod(y = de[m] - de[s]);
      de[m] = x, de[s] = y;
    }
  }
  for (int i = 0; i < N; ++i) de[i] = 1ll * de[i] * de[i] % md * rN % md;
  for (int i = 0; i < L; ++i) {
    for (int m = 0, s; m < N; ++m) {
      if (m >> i & 1) continue;
      s = m ^ (1 << i);
      amod(x = de[m] + de[s]);
      amod(y = de[m] - de[s]);
      de[m] = x, de[s] = y;
    }
  }
  for (int i = 0; i < N; ++i) {
    ab[i] = 1ll * ab[i] * f[i] % md;
    c[i] = 1ll * c[i] * f[i] % md;
    de[i] = 1ll * de[i] * f[i] % md;
  }
  aconv(N, ab, c, d, bf);
  aconv(N, d, de, c, bf);
  int rs = 0;
  for (int i = 0; i < L; ++i) amod(rs += c[1 << i]);
  printf("%d\n", rs);
  return 0;
}
