#include<stdio.h>
 
 
 
#define aaa 1000000007
 
int main(void)
{
 
 
	unsigned long long int N, B, i, j;
	unsigned long long sum=0;
 
	unsigned long long int A[30001];
	
	scanf("%llu",&N);
 
	for (i = 1;i<=N;i++)scanf("%llu",&A[i]);
 
	for(i=1;i<=N-1;i++)
		for (j = i + 1;j <= N;j++) {
			B = A[i] ^ A[j];
			
		}
	sum %= aaa;
 
 
	printf("%llu", sum);
	return 0;