#include<stdio.h>
#define N 3*10*10*10*10*10
#define M 100000007
int main()
{
long long int n;
long long int i;
long long int a = 0, sum = 0;
long long int ans = 0;
long long int s[N];
scanf("%lld", &n);
if(n>=1&&n<=N)
{
for (i = 0; i < n; i++)
{
scanf("%lld", &s[i]);
}
a = s[0];
sum = s[0];
for (i = 1; i < n; i++)
{
a = a ^ s[i];
sum += s[i];
}
ans = a + sum;
ans%=M;
printf("%lld\n",ans);
}
return 0;
}