#!python3.4.3

n = int(input())
a = list(map(int, input().split(' ')))
sum = 0
print(a)
for i in range(n-1):
    for j in range(i+1, n):
        print(a[i] ^ a[j])
        sum += a[i] ^ a[j]
print(sum % (10**9+7))
