#include <bits/stdc++.h>
const int64_t cc = pow(10, 9) + 7;
int main() {
  int64_t a, b, c, d;
  std::cin >> a;
  std::vector<int64_t> list;
  for (int i = 0; i < a; i++) {
    std::cin >> b;
    list.push_back(b);
  }
  c = 0;
  for (int i = 0; i < a; i++) {
    for (int r = i + 1; r < a; r++) {
      c += list[i] ^ list[r];
      c = c % cc;
    }
  }
  std::cout << c << "\n";
}
