#include <bits/stdc++.h>
using namespace std;
int main() {
  long int N;
  cin >> N;
  unsigned long input_num;
  vector<bitset<60>> A(N);
  for (int i = 0; i < N; i++) {
    cin >> input_num;
    A.at(i) = bitset<60>(input_num);
  }
  bitset<60> sum = 0;
  bitset<60> carry;
  bitset<60> num1, num2, num3;
  for (int i = 0; i < N - 1; i++) {
    num1 = A.at(i);
    for (int j = i + 1; j < N; j++) {
      num2 = A.at(j);
      num3 = (num1 ^ num2);
      while (num3 != 0) {
        carry = (sum & num3);
        sum = (sum ^ num3);
        num3 = carry << 1;
      }
    }
  }
  cout << sum.to_ulong() % (10 ^ 9 + 7) << endl;
  return 0;
}
