#include <bits/stdc++.h>
using namespace std;
long long inverse_m(long long a, long long b, long long s0 = 1LL,
                    long long s1 = 0LL) {
  return b == 0 ? s0 : inverse_m(b, a % b, s1, s0 - s1 * (a / b));
}
vector<long long> ORANDO(vector<long long> &a) {
  vector<long long> ans(1 << 17, 0LL);
  for (int i = 0; i < 1 << 17; i++) {
    for (int j = i; j >= 0; j = (j - 1) & i) {
      long long mult = a[i ^ j] * a[j];
      ans[i] = (ans[i] + mult) % 1000000007;
      if (j == 0) break;
    }
  }
  return ans;
}
int T[3][2][2][2] = {{{{1, 1}, {1, -1}}, {{1, 1}, {1, -1}}},
                     {{{0, 1}, {1, 1}}, {{-1, 1}, {1, 0}}},
                     {{{1, 1}, {1, 0}}, {{0, 1}, {1, -1}}}};
void FFT(vector<long long> &a, int op, bool inverse = false) {
  long long u1 = T[op][inverse][0][0], v1 = T[op][inverse][0][1];
  long long u2 = T[op][inverse][1][0], v2 = T[op][inverse][1][1];
  for (int b = 0; b < 17; b++)
    for (int i = 0; i < 1 << 17; i++)
      if ((i & (1 << b)) == 0) {
        long long u = a[i], v = a[i + (1 << b)];
        a[i] = (u * u1) + (v * v1);
        if (a[i] >= 1000000007) a[i] -= 1000000007;
        if (a[i] < 0) a[i] += 1000000007;
        a[i + (1 << b)] = (u * u2) + (v * v2);
        if (a[i + (1 << b)] >= 1000000007) a[i + (1 << b)] -= 1000000007;
        if (a[i + (1 << b)] < 0) a[i + (1 << b)] += 1000000007;
      }
  if (op == 0 && inverse) {
    long long inv = inverse_m(1 << 17, 1000000007);
    for (int i = 0; i < a.size(); i++) a[i] = (a[i] * inv) % 1000000007;
  }
}
vector<long long> convolution(vector<long long> a, vector<long long> b,
                              int op) {
  FFT(a, op, false);
  FFT(b, op, false);
  for (int i = 0; i < a.size(); i++) a[i] = (a[i] * b[i]) % 1000000007;
  FFT(a, op, true);
  return a;
}
long long fibo[1 << 17];
void build() {
  fibo[1] = 1LL;
  for (long long i = 2LL; i < 1 << 17; i++)
    fibo[i] = (fibo[i - 1] + fibo[i - 2]) % 1000000007;
}
void print(vector<long long> &a, int sz) {
  for (int i = 0; i < sz; i++) cout << a[i] << " ";
  cout << endl;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<long long> arr(1 << 17, 0LL);
  for (int i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    arr[x] += 1LL;
  }
  build();
  vector<long long> oris = ORANDO(arr);
  vector<long long> xoris = convolution(arr, arr, 0);
  for (int i = 0; i < oris.size(); i++)
    oris[i] = (fibo[i] * oris[i]) % 1000000007;
  for (int i = 0; i < xoris.size(); i++)
    xoris[i] = (xoris[i] * fibo[i]) % 1000000007;
  for (int i = 0; i < arr.size(); i++) arr[i] = (fibo[i] * arr[i]) % 1000000007;
  vector<long long> andis = convolution(oris, arr, 1);
  vector<long long> ans = convolution(andis, xoris, 1);
  long long resp = 0LL;
  for (long long i = 1LL; i < (1 << 17); i *= 2LL) {
    resp = (resp + ans[i]) % 1000000007;
  }
  printf("%lld\n", resp);
  return 0;
}
