#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a < b) {
    int tmp = a;
    a = b;
    b = tmp;
  }
  int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int lcm(int a, int b) {
  long long int L;
  L = (a * b) / gcd(a, b);
  return L;
}
vector<long long int> Prime;
void Eratosthenes(long long int n) {
  vector<bool> is_prime(n, true);
  for (int i = 2; i * i <= n; i++) {
    ;
    if (is_prime.at(i)) {
      for (int j = i * i; j <= n; j += i) {
        is_prime.at(j) = false;
      }
    }
    Prime.emplace_back(i);
  }
}
int keta(long long int N) {
  int k = 0;
  while (N > 0) {
    N /= 10;
    k++;
  }
  return k;
}
int Combination(int n, int m) {
  long long int s = 1, t = 1;
  int tmp = n;
  while (n - m != tmp) {
    s *= tmp;
    tmp--;
  }
  tmp = m;
  while (tmp != 1) {
    t *= tmp;
    tmp--;
  }
  return s / t;
}
int main() {
  long long int n, div = 1000000009, s = 0;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    a.at(i) = a.at(i) % div;
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      s += a.at(i) ^ a.at(j);
      s %= div;
    }
  }
  cout << s << endl;
}
