(defparameter *M* (+ (expt 10 9) 7))

(defun main ()
  (let* ((n (read))
	 (as (make-array n)))
    (loop for i from 0 to (1- n) do
	  (setf (aref as i) (read)))
    (rem 
      (loop for i from 0 to (- n 2) sum
	    (loop for j from (1+ i) to (1- n) sum
		  (rem (logxor (aref as i) (aref as j)) *M*)))
      *M*)))

(format t "~a~%" (main))
