#include <bits/stdc++.h>
using namespace std;
int binary(int bina) {
  int ans = 0;
  int i = 0;
  int base = 1;
  while (bina > 0) {
    ans = ans + (bina % 2) * base;
    bina = bina / 2;
    i++;
    base = base * 10;
  }
  return ans;
}
int binary_reverse(int num) {
  int ans = 0;
  for (int i = 0; num > 0; i++) {
    ans = ans + (num % 10) * pow(2, i);
    num = num / 10;
  }
  return ans;
}
int xor_func(int a, int b) {
  string as = to_string(a);
  string bs = to_string(b);
  int k1 = as.size();
  int k2 = bs.size();
  int k = max(k1, k2);
  stringstream as2, bs2;
  as2 << setw(k) << setfill('0') << as;
  bs2 << setw(k) << setfill('0') << bs;
  string as3, bs3;
  as3 = as2.str();
  bs3 = bs2.str();
  string ans = "";
  for (int i = 0; i <= k - 1; i++) {
    if ((as3[i] == '0' && bs3[i] == '1') || (as3[i] == '1' && bs3[i] == '0')) {
      ans = ans + "1";
    } else {
      ans = ans + "0";
    }
  }
  return stoi(ans);
}
int main(void) {
  int N;
  cin >> N;
  int a[N], b[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int result = 0;
  int l;
  for (int i = 0; i < N - 1; i++) {
    for (int j = i + 1; j < N; j++) {
      l = xor_func(binary(a[i]), binary(a[j]));
      result = result + binary_reverse(l);
    }
  }
  int base = 1;
  for (int i = 0; i < 9; i++) {
    base = base * 10;
  }
  base = base + 7;
  cout << result % base << endl;
}
