#include <bits/stdc++.h>
using namespace std;
const int inv2 = (1000000007 + 1) / 2;
long long c[150050], f1[150050], g[20][150050], cnt[150050], f[20][150050],
    fib[150050], f2[150050], f3[150050];
void fwt_or(long long *a, int len, int flg) {
  int i, j, k, t;
  for (k = 2; k <= len; k <<= 1) {
    for (t = k >> 1, i = 0; i < len; i += k)
      for (j = i; j < i + t; j++) {
        if (flg == 1)
          a[j + t] = (a[j + t] + a[j]) % 1000000007;
        else
          a[j + t] = (a[j + t] - a[j]) % 1000000007;
      }
  }
}
void fwt_and(long long *a, int len, int flg) {
  int i, j, k, t;
  for (k = 2; k <= len; k <<= 1) {
    for (t = k >> 1, i = 0; i < len; i += k)
      for (j = i; j < i + t; j++) {
        if (flg == 1)
          a[j] = (a[j] + a[j + t]) % 1000000007;
        else
          a[j] = (a[j] - a[j + t]) % 1000000007;
      }
  }
}
void fwt_xor(long long *a, int len, int flg) {
  int i, j, k, t;
  long long tmp;
  for (k = 2; k <= len; k <<= 1) {
    for (t = k >> 1, i = 0; i < len; i += k)
      for (j = i; j < i + t; j++) {
        tmp = a[j + t];
        a[j + t] = (a[j] - tmp) % 1000000007;
        a[j] = (a[j] + tmp) % 1000000007;
        if (flg == -1)
          a[j] = a[j] * inv2 % 1000000007,
          a[j + t] = a[j + t] * inv2 % 1000000007;
      }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  int i, x, l = 1, mx = 0, j, k;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    c[x]++;
    mx = max(mx, x);
  }
  while (l <= mx) l <<= 1;
  fib[1] = 1;
  for (i = 2; i < l; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000007;
  for (i = 1; i < l; i++) cnt[i] = cnt[i >> 1] + (i & 1);
  memcpy(f1, c, sizeof(long long) * l);
  for (i = 0; i < l; i++) g[cnt[i]][i] = c[i];
  int lim = cnt[l - 1];
  for (i = 0; i <= lim; i++) fwt_or(g[i], l, 1);
  for (i = 0; i < l; i++)
    for (j = 0; j <= lim; j++)
      if (g[j][i])
        for (k = 0; j + k <= lim; k++)
          if (g[k][i]) {
            f[j + k][i] = (f[j + k][i] + g[j][i] * g[k][i]) % 1000000007;
          }
  for (i = 0; i <= lim; i++) fwt_or(f[i], l, -1);
  for (i = 0; i < l; i++) f1[i] = f[cnt[i]][i] * fib[i] % 1000000007;
  for (i = 0; i < l; i++) f2[i] = c[i] * fib[i] % 1000000007;
  memcpy(f3, c, sizeof(long long) * l);
  fwt_xor(f3, l, 1);
  for (i = 0; i < l; i++) f3[i] = f3[i] * f3[i] % 1000000007;
  fwt_xor(f3, l, -1);
  for (i = 0; i < l; i++) f3[i] = f3[i] * fib[i] % 1000000007;
  fwt_and(f1, l, 1);
  fwt_and(f2, l, 1);
  fwt_and(f3, l, 1);
  for (i = 0; i < l; i++)
    f1[i] = f1[i] * f2[i] % 1000000007 * f3[i] % 1000000007;
  fwt_and(f1, l, -1);
  long long ans = 0;
  for (i = 0; i <= lim; i++) {
    ans = (ans + f1[1 << i]) % 1000000007;
  }
  printf("%lld\n", (ans + 1000000007) % 1000000007);
}
