#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int MAXS = 1 << 17;
const int mod = 1e9 + 7;
int n, m, s[MAXN], a[MAXS], b[MAXS], c[MAXS];
void solve_or() {
  for (int s = 0; s < m; ++s)
    for (int t = s;; t = (t - 1) & s) {
      b[s] = (b[s] + 1ll * a[t] * a[s ^ t]) % mod;
      if (!t) break;
    }
}
inline int qpow(int a, int b) {
  int re = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) re = 1ll * re * a % mod;
  return re;
}
inline void add(int &x, int y) { x = x + y >= mod ? x + y - mod : x + y; }
inline int pls(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
void FWT_xor(int *arr, int len, int flg) {
  for (int i = 2, v; i <= len; i <<= 1)
    for (int j = 0; j < len; j += i)
      for (int k = j; k < j + i / 2; ++k)
        arr[k + i / 2] = pls(arr[k], mod - (v = arr[k + i / 2])),
                    add(arr[k], v);
  if (flg == -1) {
    int iv = qpow(len, mod - 2);
    for (int i = 0; i < len; ++i) arr[i] = 1ll * arr[i] * iv % mod;
  }
}
void solve_xor() {
  FWT_xor(a, m, 1);
  for (int i = 0; i < m; ++i) c[i] = 1ll * a[i] * a[i] % mod;
  FWT_xor(a, m, -1), FWT_xor(c, m, -1);
}
int fib[MAXS];
void FWT_and(int *arr, int len, int flg) {
  if (flg == 1)
    for (int i = 2; i <= len; i <<= 1)
      for (int j = 0; j < len; j += i)
        for (int k = j; k < j + i / 2; ++k) add(arr[k], arr[k + i / 2]);
  else
    for (int i = 2; i <= len; i <<= 1)
      for (int j = 0; j < len; j += i)
        for (int k = j; k < j + i / 2; ++k) add(arr[k], mod - arr[k + i / 2]);
}
int main() {
  scanf("%d", &n);
  m = 1;
  for (int i = 1, x; i <= n; ++i) {
    scanf("%d", &x), ++a[x];
    while (m <= x) m <<= 1;
  }
  solve_or();
  solve_xor();
  fib[0] = 0, fib[1] = 1;
  for (int i = 2; i < m; ++i) fib[i] = pls(fib[i - 2], fib[i - 1]);
  for (int i = 0; i < m; ++i)
    a[i] = 1ll * a[i] * fib[i] % mod, b[i] = 1ll * b[i] * fib[i] % mod,
    c[i] = 1ll * c[i] * fib[i] % mod;
  FWT_and(a, m, 1), FWT_and(b, m, 1), FWT_and(c, m, 1);
  for (int i = 0; i < m; ++i) a[i] = 1ll * a[i] * b[i] % mod * c[i] % mod;
  FWT_and(a, m, -1);
  int ans = 0;
  for (int i = 1; i < m; i <<= 1) add(ans, a[i]);
  printf("%d\n", ans);
}
