open Array
let modulo = 1000000007
let (+@) a b = (a + b) mod modulo
let ( *@ ) a b = (a * b) mod modulo

let () =
  Scanf.scanf "%d %d" @@ fun n m ->
  let x = init n (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let y = init m (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let xw = init (n-1) (fun i -> (x.(i+1)-x.(i)) *@ (i+1) *@ (n-1-i)) |> fold_left (+@) 0 in
  let yw = init (m-1) (fun i -> (y.(i+1)-y.(i)) *@ (i+1) *@ (m-1-i)) |> fold_left (+@) 0 in
  Printf.printf "%d\n" (xw *@ yw)