N = int(input())
A = list(map(int, input().split()))

l = (10 ** 9) + 7

res = 0
for i in range(0, N-1):
    for j in range(i, N):
        print(A[i] , A[j])
        res += A[i] ^ A[j]

print(res % l)