#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
long long N;
long long A[1111111];
long long cnt[1 << 17];
long long cntX[1 << 17];
long long cntY[1 << 17];
const long long mod = 1000000007;
inline void add(long long &a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
}
vector<long long> FWHT(vector<long long> P, bool inverse) {
  for (long long len = 1; 2 * len <= P.size(); len <<= 1) {
    for (long long i = 0; i < P.size(); i += 2 * len) {
      for (long long j = 0; j < len; j++) {
        long long u = P[i + j];
        long long v = P[i + len + j];
        P[i + j] = u + v;
        P[i + len + j] = u - v;
      }
    }
  }
  if (inverse) {
    for (long long i = 0; i < P.size(); i++) P[i] = P[i] / P.size();
  }
  return P;
}
void zeta(long long f[1 << 17]) {
  for (long long i = 0; i < (17); i++)
    for (long long b = 0; b < (1 << 17); b++)
      if (0 == (b & (1 << i))) f[b] += f[b | (1 << i)];
}
void me(long long f[1 << 17]) {
  for (long long i = 0; i < (17); i++)
    for (long long b = 0; b < (1 << 17); b++)
      if (b & (1 << i)) f[b] -= f[b ^ (1 << i)];
}
long long fib[1 << 17];
signed main() {
  fib[0] = 0;
  fib[1] = 1;
  for (long long i = 2; i < 1 << 17; i++)
    fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  scanf("%lld", &N);
  for (long long i = 0; i < (N); i++) {
    scanf("%lld", &A[i]);
    cnt[A[i]]++;
  }
  for (long long i = 0; i < (1 << 17); i++) {
    long long sup = (1 << 17) - 1 - i;
    long long sub = sup;
    do {
      cntX[i | sub] += cnt[i] * cnt[sub];
      sub = (sub - 1) & sup;
    } while (sub != sup);
  }
  for (long long i = 0; i < (1 << 17); i++) cntX[i] %= mod;
  vector<long long> P(1 << 17);
  for (long long i = 0; i < (1 << 17); i++) P[i] = cnt[i];
  P = FWHT(P, false);
  for (long long i = 0; i < (P.size()); i++) P[i] = P[i] * P[i];
  P = FWHT(P, true);
  for (long long i = 0; i < (1 << 17); i++) cntY[i] = P[i] % mod;
  for (long long i = 0; i < (1 << 17); i++) {
    cnt[i] = cnt[i] * fib[i] % mod;
    cntX[i] = cntX[i] * fib[i] % mod;
    cntY[i] = cntY[i] * fib[i] % mod;
  }
  zeta(cnt);
  zeta(cntX);
  zeta(cntY);
  for (long long i = 0; i < (1 << 17); i++) {
    cnt[i] = (cnt[i] % mod + mod) % mod;
    cntX[i] = (cntX[i] % mod + mod) % mod;
    cntY[i] = (cntY[i] % mod + mod) % mod;
    cnt[i] = cnt[i] * cntX[i] % mod * cntY[i] % mod;
  }
  for (long long i = 0; i < 1 << 16; i++) swap(cnt[i], cnt[(1 << 17) - 1 - i]);
  me(cnt);
  for (long long i = 0; i < 1 << 16; i++) swap(cnt[i], cnt[(1 << 17) - 1 - i]);
  long long ans = 0;
  for (long long i = 1; i < 1 << 17; i <<= 1) {
    cnt[i] = (cnt[i] % mod + mod) % mod;
    ans = (ans + cnt[i]) % mod;
  }
  cout << ans << endl;
  return 0;
}
