#include <bits/stdc++.h>
const int mod = 1000000007, N = 1 << 17;
int mul(int a, int b) { return a * (long long)b % mod; }
int ad(int a, int b) { return (a + b) % mod; }
int de(int a, int b) { return (a - b) % mod; }
int pow(int a, int b) {
  int s = 1;
  while (b) {
    if (b & 1) s = mul(s, a);
    a = mul(a, a);
    b >>= 1;
  }
  return s;
}
void fwt_xor(int* a, int on) {
  int i, j, k, t;
  for (i = 2; i <= N; i <<= 1) {
    for (j = 0; j < N; j += i) {
      for (k = 0; k < i >> 1; k++) {
        t = a[i / 2 + j + k];
        a[i / 2 + j + k] = de(a[j + k], t);
        a[j + k] = ad(a[j + k], t);
      }
    }
  }
  if (on == -1) {
    t = pow(N, mod - 2);
    for (i = 0; i < N; i++) a[i] = mul(a[i], t);
  }
}
void fwt_or(int* a, int on) {
  int i, j, k;
  for (i = 2; i <= N; i <<= 1) {
    for (j = 0; j < N; j += i) {
      for (k = 0; k < i >> 1; k++)
        a[i / 2 + j + k] = ad(a[i / 2 + j + k], on * a[j + k]);
    }
  }
}
void fwt_and(int* a, int on) {
  int i, j, k;
  for (i = 2; i <= N; i <<= 1) {
    for (j = 0; j < N; j += i) {
      for (k = 0; k < i >> 1; k++)
        a[j + k] = ad(a[j + k], on * a[i / 2 + j + k]);
    }
  }
}
int f[18][N], g[18][N], cnt[N];
void conv(int* a) {
  int i, j, k;
  memset(f, 0, sizeof(f));
  memset(g, 0, sizeof(g));
  for (i = 0; i < N; i++) f[cnt[i]][i] = a[i];
  for (i = 0; i < 18; i++) fwt_or(f[i], 1);
  for (i = 0; i < 18; i++) {
    for (j = 0; j <= i; j++) {
      for (k = 0; k < N; k++) g[i][k] = ad(g[i][k], mul(f[j][k], f[i - j][k]));
    }
  }
  for (i = 0; i < 18; i++) fwt_or(g[i], -1);
  for (i = 0; i < N; i++) a[i] = g[cnt[i]][i];
}
int fib[N], A[N], B[N], C[N], D[N];
int main() {
  int n, i, s;
  fib[1] = 1;
  for (i = 2; i < N; i++) fib[i] = ad(fib[i - 1], fib[i - 2]);
  for (i = 1; i < N; i++) cnt[i] = cnt[i >> 1] + (i & 1);
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &i);
    A[i]++;
  }
  for (i = 0; i < N; i++) D[i] = C[i] = B[i] = A[i];
  conv(B);
  fwt_xor(D, 1);
  for (i = 0; i < N; i++) D[i] = mul(D[i], D[i]);
  fwt_xor(D, -1);
  for (i = 0; i < N; i++) {
    B[i] = mul(B[i], fib[i]);
    C[i] = mul(C[i], fib[i]);
    D[i] = mul(D[i], fib[i]);
  }
  fwt_and(B, 1);
  fwt_and(C, 1);
  fwt_and(D, 1);
  for (i = 0; i < N; i++) A[i] = mul(mul(B[i], C[i]), D[i]);
  fwt_and(A, -1);
  s = 0;
  for (i = 1; i < N; i <<= 1) s = ad(s, A[i]);
  printf("%d", ad(s, mod));
}
