N = int(input())
numlist = input().split(' ') 
sum = 0

for i in range(N-1):
  for j in range(N-1):
    if i-j>0:
      continue    
    else:
      print(i, j)
      sum += int(numlist[i])^int(numlist[j+1])
    
print(int(sum % (10**9 + 7)))