#include <bits/stdc++.h>
long long int a[400000];
long long int n, m;
long long int s = 0, i, j, p;
int main() {
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  for (i = 0; i < n; i++) {
    p = (a[i] ^ a[i]);
    s += p;
    s = s % 1000000007;
  }
  printf("%lld\n", s);
}
