#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const long long int N = 1 << 17;
const long long int inv = 742744451;
long long int cnt[N], fib[N];
vector<long long int> poly[3];
long long int rev(long long int n) {
  long long int res = 0;
  for (long long int i = 0; i < 17; i++)
    if (n & (1 << i)) res |= 1 << (16 - i);
  return res;
}
void xor_fft(vector<long long int> &a, bool invert) {
  for (long long int i = 0; i < N; i++)
    if (i < rev(i)) swap(a[i], a[rev(i)]);
  for (long long int len = 2; len <= N; len <<= 1) {
    for (long long int i = 0; i < N; i += len) {
      for (long long int j = 0; j < len / 2; j++) {
        long long int u = a[i + j], v = a[i + j + len / 2];
        a[i + j] = ((u + v) >= 1000000007 ? (u + v - 1000000007) : u + v);
        a[i + j + len / 2] = ((u - v) < 0 ? (u - v + 1000000007) : u - v);
      }
    }
  }
  if (invert)
    for (auto &i : a) i = (i * inv) % 1000000007;
}
void and_fft(vector<long long int> &a, bool invert) {
  for (long long int i = 0; i < N; i++)
    if (i < rev(i)) swap(a[i], a[rev(i)]);
  for (long long int len = 2; len <= N; len <<= 1) {
    for (long long int i = 0; i < N; i += len) {
      for (long long int j = 0; j < len / 2; j++) {
        long long int u = a[i + j], v = a[i + j + len / 2];
        if (invert) {
          a[i + j] = ((v - u) < 0 ? (v - u + 1000000007) : v - u);
          a[i + j + len / 2] = u;
        } else {
          a[i + j] = v;
          a[i + j + len / 2] =
              ((u + v) >= 1000000007 ? (u + v - 1000000007) : u + v);
        }
      }
    }
  }
}
vector<long long int> multiply(vector<long long int> a, vector<long long int> b,
                               bool isxor) {
  vector<long long int> res(N);
  if (isxor) {
    xor_fft(a, 0);
    xor_fft(b, 0);
    for (long long int i = 0; i < N; i++) a[i] = (a[i] * b[i]) % 1000000007;
    xor_fft(a, 1);
    for (long long int i = 0; i < N; i++) res[i] = a[i];
  } else {
    and_fft(a, 0);
    and_fft(b, 0);
    for (long long int i = 0; i < N; i++) a[i] = (a[i] * b[i]) % 1000000007;
    and_fft(a, 1);
    for (long long int i = 0; i < N; i++) res[i] = a[i];
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  fib[1] = 1;
  for (long long int i = 2; i < N; i++)
    fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000007;
  for (long long int i = 0; i < 3; i++) poly[i].resize(N);
  long long int n;
  cin >> n;
  long long int s[n + 1];
  for (long long int i = 1; i <= n; i++)
    cin >> s[i], cnt[s[i]]++, poly[1][s[i]]++;
  for (long long int i = 0; i < N; i++) {
    poly[0][i] = (poly[0][i] + cnt[i] * cnt[0]) % 1000000007;
    long long int x = (i ^ (N - 1));
    for (long long int j = x; j; j = (j - 1) & x)
      poly[0][i | j] = (poly[0][i | j] + cnt[i] * cnt[j]) % 1000000007;
  }
  poly[2] = multiply(poly[1], poly[1], 1);
  for (long long int i = 0; i < N; i++)
    for (long long int j = 0; j < 3; j++)
      poly[j][i] = (poly[j][i] * fib[i]) % 1000000007;
  poly[0] = multiply(poly[0], poly[1], 0);
  poly[0] = multiply(poly[0], poly[2], 0);
  long long int ans = 0;
  for (long long int i = 1; i < N; i <<= 1)
    ans = (ans + poly[0][i]) % 1000000007;
  cout << ans;
}
