N = int(input())
A = [int(i) for i in input().split()]
s = 0

for i in range(N):
    for j in range(i+1,N):
        c = 1
        q1,mod1 = divmod(A[i],2)
        q2,mod2 = divmod(A[j],2)
        g = 1
        while g != 0:
            if mod1 ^ mod2:
                #print(A[i],A[j])
                #print("a")
                s += c
                s = s%(10**9+7)
            g = max(q1,q2)
            q1,mod1 = divmod(q1,2)
            q2,mod2 = divmod(q2,2)
            c*=2

print(s)