#include <bits/stdc++.h>
int main() {
  long long n, i, j, count = 0, index = 1;
  scanf("%lld", &n);
  long long a[n], x[n];
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    x[i] = a[i];
  }
  for (i = 0; i < n - 1; i++)
    for (j = i + 1; j < n; j++) {
      while (x[i] > 0 || x[j] > 0) {
        if (x[i] % 2 != x[j] % 2) {
          count += index;
          count %= 1000000007;
        }
        index *= 2;
        x[i] /= 2;
        x[j] /= 2;
      }
      index = 1;
      x[i] = a[i];
      x[j] = a[j];
    }
  printf("%d\n", count);
  return 0;
}
