#include <bits/stdc++.h>
using namespace std;
int n;
int fib[1000010];
int s[1000010];
void FWT_xor(int f[], int l, int type) {
  for (int i = 2; i <= l; i = i << 1) {
    for (int j = 0; j < l; j += i) {
      for (int k = j; k < j + i / 2; ++k) {
        int u = f[k], t = f[k + i / 2];
        f[k] = (u + t) % 1000000007;
        f[k + i / 2] = (u - t + 1000000007) % 1000000007;
        if (type == -1) {
          f[k] = 1ll * f[k] * 500000004 % 1000000007;
          f[k + i / 2] = 1ll * f[k + i / 2] * 500000004 % 1000000007;
        }
      }
    }
  }
  return;
}
void FWT_and(int f[], int l, int type) {
  for (int i = 2; i <= l; i = i << 1)
    for (int j = 0; j < l; j += i)
      for (int k = j; k < j + i / 2; ++k)
        f[k] = (f[k] + 1ll * (1000000007 + type) * f[k + i / 2] % 1000000007) %
               1000000007;
  return;
}
void FWT_or(int f[], int l, int type) {
  for (int i = 2; i <= l; i = i << 1)
    for (int j = 0; j < l; j += i)
      for (int k = j; k < j + i / 2; ++k)
        f[k + i / 2] =
            (f[k + i / 2] + 1ll * (1000000007 + type) * f[k] % 1000000007) %
            1000000007;
  return;
}
int bit[1000010];
int cnt[1000010], cnt2[1000010], cnt3[1000010];
int f[18][1000010], g[18][1000010];
void calc1(int cnt[], int cnt2[], int len) {
  for (int i = 0; i < len; ++i) f[bit[i]][i] = cnt[i];
  for (int i = 0; i <= 17; ++i) FWT_or(f[i], len, 1);
  for (int i = 0; i <= 17; ++i)
    for (int j = 0; j <= i; ++j)
      for (int s = 0; s < len; ++s)
        g[i][s] =
            (g[i][s] + 1ll * f[j][s] * f[i - j][s] % 1000000007) % 1000000007;
  for (int i = 0; i <= 17; ++i) FWT_or(g[i], len, -1);
  for (int s = 0; s < len; ++s)
    cnt2[s] = 1ll * g[bit[s]][s] * fib[s] % 1000000007;
  return;
}
int ans[1000010];
int main() {
  scanf("%d", &n);
  int mx = 0;
  for (int i = 1; i <= n; ++i) scanf("%d", &s[i]);
  for (int i = 1; i <= n; ++i) mx = max(mx, s[i]);
  int len = 1;
  for (; len <= mx; len = len << 1)
    ;
  for (int i = 1; i < len; ++i) bit[i] = bit[i ^ (i & (-i))] + 1;
  fib[0] = 0;
  fib[1] = 1;
  for (int i = 2; i < 200000; ++i)
    fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000007;
  for (int i = 1; i <= n; ++i) ++cnt[s[i]];
  calc1(cnt, cnt2, len);
  FWT_xor(cnt, len, 1);
  for (int i = 0; i < len; ++i) cnt3[i] = 1ll * cnt[i] * cnt[i] % 1000000007;
  FWT_xor(cnt, len, -1);
  FWT_xor(cnt3, len, -1);
  for (int i = 0; i < len; ++i) cnt3[i] = 1ll * cnt3[i] * fib[i] % 1000000007;
  for (int i = 0; i < len; ++i) cnt[i] = 1ll * cnt[i] * fib[i] % 1000000007;
  FWT_and(cnt, len, 1);
  FWT_and(cnt2, len, 1);
  FWT_and(cnt3, len, 1);
  for (int i = 0; i < len; ++i)
    ans[i] = 1ll * cnt[i] * cnt2[i] % 1000000007 * cnt3[i] % 1000000007;
  FWT_and(ans, len, -1);
  int cur = 1, res = 0;
  while (cur < len) res = (res + ans[cur]) % 1000000007, cur = cur << 1;
  cout << res << endl;
  return 0;
}
