#include <bits/stdc++.h>
int n, i;
long long a[300005], sum;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sum = 0;
  for (i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      sum += (a[i] % 1000000009) ^ (a[j] % 1000000009);
      sum %= 1000000009;
    }
  }
  printf("%lld\n", sum);
}
