n = int(input())
ai = list(map(int, input().split()))
ans = 0

print(ai)

for i in range(n-1):
  for j in range(i+1, n):
    ans += ai[i] ^ ai[j]
    ans = ans % (pow(10,9)+7)
    print(str(ai[i]) + " " + str(ai[j]) + "  = " + str(ai[i] ^ ai[j]))


print(ans)

