N = int(input())
A = [int(x) for x in input().split()]
res = 0
for i in range(N-1):
    for j in range(i+1, N):
        x1 = [0]*61
        y1 = bin(A[i])[2:]
        for n in range(len(y1)):
            x1[n] = int(y1[len(y1)-1-n])
        x1 = x1[::-1]
        x2 = [0]*61
        y2 = bin(A[j])[2:]
        for n in range(len(y2)):
            x2[n] = int(y2[len(y2)-1-n])
        x2 = x2[::-1]
        new_ = "0b"
        t = False
        for k in range(61):
            u = (x2[k]+x1[k])%2
            if u == 1:
                t = True
            if t:
                new_ += str(u)
        if new_ != "0b":
            res = (res + int(new_,2))%(10**9+7)
print(res)
