object Main extends App {
	val sc = new java.util.Scanner(System.in)
	val n  = sc.nextInt
	val a  = Array.fill(n)(sc.nextLong)
	
	val MOD = 1000000007
	
	println((for(i <- 0 to n-2; j <- i+1 to n-1) yield (a(i) ^ a(j)) % MOD).sum % MOD)
}