#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int nega = 1;
  while (!isdigit(ch)) {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  int ans = 0;
  while (isdigit(ch)) {
    ans = ans * 10 + ch - 48;
    ch = getchar();
  }
  if (nega == -1) return -ans;
  return ans;
}
inline int min(int x, int y, int z) { return min(x, min(y, z)); }
inline int max(int x, int y, int z) { return max(x, max(y, z)); }
inline int add(int x, int y) {
  return x + y >= 1000000007 ? x + y - 1000000007 : x + y;
}
inline int add(int x, int y, int z) { return add(add(x, y), z); }
inline int sub(int x, int y) { return x - y < 0 ? x - y + 1000000007 : x - y; }
inline int mul(int x, int y) { return 1LL * x * y % 1000000007; }
inline int mul(int x, int y, int z) { return mul(mul(x, y), z); }
inline void div2(int &x) {
  if (x & 1)
    x = (x + 1000000007) >> 1;
  else
    x >>= 1;
}
int cnt[200005], fi[200005];
int a[200005], b[200005], c[200005], t[200005], x[200005], h[200005], n = 17;
int f[18][200005];
void fwt_or(int a[], int typ) {
  for (int i = 1; i < (1 << n); i <<= 1) {
    for (int j = 0; j < (1 << n); j += (i << 1)) {
      for (int k = 0; k < i; k++) {
        if (typ == 1)
          a[i + j + k] = add(a[i + j + k], a[j + k]);
        else
          a[i + j + k] = sub(a[i + j + k], a[j + k]);
      }
    }
  }
}
void fwt_xor(int a[], int typ) {
  for (int i = 1; i < (1 << n); i <<= 1) {
    for (int j = 0; j < (1 << n); j += (i << 1)) {
      for (int k = 0; k < i; k++) {
        int x = a[j + k], y = a[i + j + k];
        a[j + k] = add(x, y), a[i + j + k] = sub(x, y);
        if (typ == -1) div2(a[i + j + k]), div2(a[j + k]);
      }
    }
  }
}
void fwt_and(int a[], int typ) {
  for (int i = 1; i < (1 << n); i <<= 1) {
    for (int j = 0; j < (1 << n); j += (i << 1)) {
      for (int k = 0; k < i; k++) {
        if (typ == 1)
          a[k + j] = add(a[i + j + k], a[j + k]);
        else
          a[k + j] = sub(a[j + k], a[i + j + k]);
      }
    }
  }
}
void solve() {
  for (int i = 0; i < (1 << n); i++) f[cnt[i]][i] = x[i];
  for (int i = 0; i <= n; i++) fwt_or(f[i], 1);
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < (1 << n); j++) h[j] = 0;
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k < (1 << n); k++)
        h[k] = add(h[k], mul(f[j][k], f[i - j][k]));
    }
    fwt_or(h, -1);
    for (int j = 0; j < (1 << n); j++)
      if (cnt[j] == i) a[j] = add(a[j], h[j]);
  }
}
signed main() {
  int k = read();
  for (int i = 1; i <= k; i++) t[read()]++;
  for (int i = 0; i < (1 << n); i++) cnt[i] = __builtin_popcount(i);
  fi[1] = 1;
  for (int i = 2; i < (1 << n); i++) fi[i] = add(fi[i - 1], fi[i - 2]);
  for (int i = 0; i < (1 << n); i++) x[i] = t[i];
  solve();
  for (int i = 0; i < (1 << n); i++) a[i] = mul(a[i], fi[i]);
  for (int i = 0; i < (1 << n); i++) b[i] = mul(t[i], fi[i]);
  for (int i = 0; i < (1 << n); i++) x[i] = t[i];
  fwt_xor(x, 1);
  for (int i = 0; i < (1 << n); i++) x[i] = mul(x[i], x[i]);
  fwt_xor(x, -1);
  for (int i = 0; i < (1 << n); i++) c[i] = mul(x[i], fi[i]);
  fwt_and(a, 1);
  fwt_and(b, 1);
  fwt_and(c, 1);
  for (int i = 0; i < (1 << n); i++) a[i] = mul(a[i], b[i], c[i]);
  fwt_and(a, -1);
  int ans = 0;
  for (int i = 0; i <= n; i++) ans = add(ans, a[1 << i]);
  cout << ans << endl;
  return 0;
}
