import itertools
x = 10 ** 9
S = int(input())
a = [int(i) for i in input().split()]
 
xor = 0
patern = list(itertools.combinations(a, 2))
for p in patern:
    xor += p[0] ^ p[1]
if xor >= x:
    print(xor % (x + 7))
else:
    print(xor)