#include <bits/stdc++.h>
using namespace std;
int a[(1 << 17)];
int b[(1 << 17)], c[(1 << 17)], d[(1 << 17)];
const int mod = 1e9 + 7;
long long expmod(long long a, long long b, long long mod) {
  long long rlt = 1;
  for (a %= mod; b; a = a * a % mod, b >>= 1)
    if (b & 1) rlt = rlt * a % mod;
  return rlt;
}
void add(int &x, long long y) { x = (x + y) % mod; }
void fwt_xor(int a[], int len, bool fg) {
  for (int half = 1; half < len; half <<= 1) {
    for (int i = 0; i < len; i += half << 1) {
      for (int j = 0; j < half; j++) {
        int x = a[i + j], y = a[i + j + half];
        a[i + j] = (x + y) % mod;
        a[i + j + half] = (x + mod - y) % mod;
      }
    }
  }
  int rev_n = expmod(len, mod - 2, mod);
  if (fg) {
    for (int i = 0; i < len; i++) a[i] = (1ll * rev_n * a[i]) % mod;
  }
}
void fwt(int a[], int len) {
  for (int half = 1; half < len; half <<= 1) {
    for (int i = 0; i < len; i += half << 1) {
      for (int j = 0; j < half; j++) {
        a[i + j] = (a[i + j + half] + a[i + j]) % mod;
      }
    }
  }
}
void ufwt(int a[], int len) {
  for (int half = 1; half < len; half <<= 1) {
    for (int i = 0; i < len; i += half << 1) {
      for (int j = 0; j < half; j++) {
        a[i + j] = (a[i + j] - a[i + j + half] + mod) % mod;
      }
    }
  }
}
int f[(1 << 17)];
int main() {
  f[0] = 0, f[1] = 1;
  for (int i = 2; i < (1 << 17); i++) f[i] = (f[i - 1] + f[i - 2]) % mod;
  int n, s;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &s);
    a[s]++;
  }
  for (int k = 0; k < (1 << 17); k++) {
    for (int i = k; i; i = (i - 1) & k) {
      add(b[k], 1ll * a[i] * a[k ^ i]);
    }
    add(b[k], 1ll * a[0] * a[k]);
  }
  memcpy(c, a, (1 << 17) * 4);
  fwt_xor(c, (1 << 17), 0);
  for (int i = 0; i < (1 << 17); i++) c[i] = 1ll * c[i] * c[i] % mod;
  fwt_xor(c, (1 << 17), 1);
  for (int i = 0; i < (1 << 17); i++) {
    a[i] = 1ll * a[i] * f[i] % mod;
    b[i] = 1ll * b[i] * f[i] % mod;
    c[i] = 1ll * c[i] * f[i] % mod;
  }
  fwt(a, (1 << 17));
  fwt(b, (1 << 17));
  fwt(c, (1 << 17));
  for (int i = 0; i < (1 << 17); i++) {
    a[i] = 1ll * a[i] * b[i] % mod * c[i] % mod;
  }
  ufwt(a, (1 << 17));
  int ans = 0;
  for (int i = 0; i < 17; i++) add(ans, a[1 << i]);
  cout << ans << endl;
}
