import itertools
def main():
	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(np.mod(xor, (x + 7)))
	else:
    	print(xor)


if __name__ == '__main__':
    main()