let m = 1000000007
let ( +^ ) x y = (x + y) mod m
let ( *^ ) x y = (x * y) mod m

let () = Scanf.scanf "%d\n" @@ fun n ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  Printf.printf "%d\n" @@
  Array.fold_left ( +^ ) 0 @@
  Array.init 62 @@ fun d ->
    let c0, c1 =
      Array.fold_left (fun (c0, c1) a ->
        if a land (1 lsl d) = 0
        then (c0 + 1, c1)
        else (c0, c1 + 1)) (0, 0) as_ in
    c0 *^ c1 *^ ((1 lsl d) mod m)

