#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 300005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
void FWT0(long long a[], int n) {
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = (x + y) % _p, a[i + j + d] = (x - y + _p) % _p;
      }
}
void UFWT0(long long a[], int n) {
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = 1ll * (x + y) * 500000004 % _p,
              a[i + j + d] = (1ll * (x - y) * 500000004 % _p + _p) % _p;
      }
}
void FWT1(long long a[], int n) {
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = (x + y) % _p;
      }
}
void UFWT1(long long a[], int n) {
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = (x - y + _p) % _p;
      }
}
void FST(long long *a, int n, long long *f) {
  memset(f, 0, sizeof(f));
  for (int i = 0; i <= n; i++) {
    for (int j = i;; j = (j - 1) & i) {
      f[i] += a[j] * a[i ^ j];
      if (j == 0) break;
    }
    f[i] %= _p;
  }
}
int n, x;
long long ans = 0, a[N], b[N], c[N], f[N];
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) scanf("%d", &x), b[x]++, c[x]++;
  n = (1 << 17) - 1, FST(b, n, a);
  FWT0(c, n);
  for (int i = (0); i <= (n); ++i) c[i] = c[i] * c[i] % _p;
  UFWT0(c, n);
  f[1] = 1;
  for (int i = (2); i <= (n); ++i) f[i] = (f[i - 1] + f[i - 2]) % _p;
  for (int i = (0); i <= (n); ++i)
    a[i] = a[i] * f[i] % _p, b[i] = b[i] * f[i] % _p, c[i] = c[i] * f[i] % _p;
  FWT1(a, n), FWT1(b, n), FWT1(c, n);
  for (int i = (0); i <= (n); ++i) a[i] = a[i] * b[i] % _p * c[i] % _p;
  UFWT1(a, n);
  for (int i = (0); i <= (16); ++i) (ans += a[1 << i]) %= _p;
  printf("%I64d\n", ans);
  return 0;
}
