(defun split (x str)
  (let ((pos (search x str))
        (size (length x)))
    (if pos
      (cons (subseq str 0 pos)
            (split x (subseq str (+ pos size))))
      (list str))))
 
(defparameter N (parse-integer (read-line)))
(defparameter data 
  (make-array N 
              :initial-contents
              (mapcar #'parse-integer (split " " (read-line)))))
 
(let ((answer 0))
     (loop for i from 0 to (- N 2) do
           (loop for j from (1+ i) to (- N 1) do
                 (let ((value (mod (logxor (aref data i)
                                           (aref data j))
                                   (+ 7 (expt 10 9)))))
                      (setf answer (+ answer value)))
                 (if (> answer (+ 7 (expt 10 9)))
                     (setf answer (mod answer (+ 7 (expt 10 9)))))))
     (format t "~A" answer))