# coding: utf-8
n_integer = int(input())
integers = [int(x) for x in input().split(' ')]


exclusiveor_list = [integers[i] ^ integers[i+j+1] for i in range(n_integer - 1) for j in range(n_integer - 1 - i)]
        
print(sum(exclusiveor_list) % (10**9 + 7))