#include <bits/stdc++.h>
using namespace std;
int gi() {
  int res = 0, s = 1;
  char ch;
  for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') s = -1, ch = getchar();
  for (; ch >= '0' && ch <= '9'; ch = getchar()) res = res * 10 + ch - 48;
  return res * s;
}
int n, A[131100], B[131100], C[131100], all, Fib[131100], f[20][131100],
    h[20][131100], cnt[131100];
void fwt(int x[]) {
  for (int p = 1; p <= all; p <<= 1)
    for (int s = 0; s <= all; ++s) {
      if (s & p) continue;
      int u = x[s], v = x[s | p];
      x[s] = u + v;
      x[s] >= 1000000007 ? x[s] -= 1000000007 : 0;
      x[s | p] = u - v;
      x[s | p] < 0 ? x[s | p] += 1000000007 : 0;
    }
}
void fmt(int x[]) {
  for (int p = 1; p <= all; p <<= 1)
    for (int s = 0; s <= all; ++s)
      if (!(s & p))
        x[s] += x[s | p], x[s] >= 1000000007 ? x[s] -= 1000000007 : 0;
}
void ufmt(int x[]) {
  for (int p = 1; p <= all; p <<= 1)
    for (int s = 0; s <= all; ++s)
      if (!(s & p)) x[s] -= x[s | p], x[s] < 0 ? x[s] += 1000000007 : 0;
}
int main() {
  n = gi();
  all = 131071;
  for (int i = 1, x; i <= n; ++i) x = gi(), A[x]++, B[x]++, C[x]++;
  Fib[0] = 0, Fib[1] = 1;
  for (int i = 2; i <= all; ++i) {
    Fib[i] = Fib[i - 1] + Fib[i - 2];
    Fib[i] >= 1000000007 ? Fib[i] -= 1000000007 : 0;
  }
  for (int i = 1; i <= all; ++i) cnt[i] = cnt[i - (i & -i)] + 1;
  for (int i = 0; i <= all; ++i) f[cnt[i]][i] = A[i];
  for (int i = 0; i <= 17; ++i)
    for (int p = 1; p <= all; p <<= 1)
      for (int s = 0; s <= all; ++s)
        if (!(s & p))
          f[i][s | p] += f[i][s],
              f[i][s | p] >= 1000000007 ? f[i][s | p] -= 1000000007 : 0;
  memset(A, 0, sizeof(A));
  for (int i = 0; i <= 17; ++i)
    for (int j = 0; j <= 17 - i; ++j)
      for (int s = 0; s <= all; ++s)
        h[i + j][s] += 1ll * f[i][s] * f[j][s] % 1000000007,
            h[i + j][s] >= 1000000007 ? h[i + j][s] -= 1000000007 : 0;
  for (int i = 0; i <= 17; ++i)
    for (int p = 1; p <= all; p <<= 1)
      for (int s = 0; s <= all; ++s)
        if (!(s & p))
          h[i][s | p] -= h[i][s],
              h[i][s | p] < 0 ? h[i][s | p] += 1000000007 : 0;
  for (int i = 0; i <= all; ++i) A[i] = h[cnt[i]][i];
  fwt(B);
  for (int s = 0; s <= all; ++s) B[s] = 1ll * B[s] * B[s] % 1000000007;
  fwt(B);
  for (int s = 0; s <= all; ++s) B[s] = 1ll * B[s] * 742744451 % 1000000007;
  for (int i = 0; i <= all; ++i) {
    A[i] = 1ll * A[i] * Fib[i] % 1000000007;
    B[i] = 1ll * B[i] * Fib[i] % 1000000007;
    C[i] = 1ll * C[i] * Fib[i] % 1000000007;
  }
  fmt(A), fmt(B), fmt(C);
  for (int i = 0; i <= all; ++i)
    C[i] = 1ll * A[i] * C[i] % 1000000007 * B[i] % 1000000007;
  ufmt(C);
  int ans = 0;
  for (int i = 0; i < 17; ++i) {
    ans += C[1 << i];
    ans >= 1000000007 ? ans -= 1000000007 : 0;
  }
  printf("%d\n", ans);
  return 0;
}
