#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
ll fexp(ll b, ll e = mod - 2) {
  ll ans = 1;
  while (e) {
    if (e & 1) ans = ans * b % mod;
    b = b * b % mod;
    e /= 2;
  }
  return ans;
}
template <typename T>
vector<T> operator+(const vector<T> &a, const vector<T> &b) {
  vector<T> ans(a.size());
  for (size_t i = 0; i < a.size(); i++) ans[i] = a[i] + b[i];
  return ans;
}
template <typename T>
vector<T> operator-(const vector<T> &a, const vector<T> &b) {
  vector<T> ans(a.size());
  for (size_t i = 0; i < a.size(); i++) ans[i] = (a[i] - b[i] + mod) % mod;
  return ans;
}
struct tad {
  ll s, s2, cnt;
  tad() : s(0), s2(0), cnt(0) {}
  tad operator+(const tad &o) const {
    tad ans;
    ans.s = (s + o.s + s * o.cnt + o.s * cnt) % mod;
    ans.cnt = (cnt + o.cnt + cnt * o.cnt) % mod;
    ans.s2 = s2 + o.s2 + s2 * o.cnt + o.s2 * cnt + 2 * s * o.s;
    ans.s2 %= mod;
    return ans;
  }
};
size_t all;
vector<ll> f(const vector<tad> &cnt) {
  if ((int)cnt.size() == 1) {
    return vector<ll>{cnt[0].s2};
  }
  vector<tad> cnt_f[10];
  for (int i = 0; i < 10; i++) cnt_f[i].resize(cnt.size() / 10);
  int subsize = int(cnt.size() / 10);
  for (int i = 0; i < (int)cnt.size(); i++) {
    cnt_f[i / subsize][i % subsize] = cnt[i];
  }
  vector<ll> g(cnt.size());
  vector<ll> tmp[10];
  for (int i = 9; i >= 0; i--) {
    if (i + 1 < 10) cnt_f[i] = cnt_f[i] + cnt_f[i + 1];
    tmp[i] = f(cnt_f[i]);
    auto cp = tmp[i];
    if (i < 9) cp = cp - tmp[i + 1];
    std::copy(cp.begin(), cp.end(), &g[i * subsize]);
  }
  return g;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v(n);
  for (int &x : v) scanf("%d", &x);
  vector<tad> vet(1000000);
  for (int x : v) {
    tad aux;
    aux.cnt = 1;
    aux.s = x;
    aux.s2 = 1LL * x * x % mod;
    vet[x] = vet[x] + aux;
  }
  auto qwe = f(vet);
  ll ans = 0;
  for (int i = 0; i < (int)qwe.size(); i++) {
    if (qwe[i] <= 0) continue;
    ans ^= i * qwe[i];
  }
  printf("%lld\n", ans);
  return 0;
}
