import Control.Applicative
import Data.Array.IArray
import Data.List

main = do
  (n:m:_) <- (map read) . words <$> getLine
  xs <- (map (read::String->Integer)) . words <$> getLine
  ys <- (map (read::String->Integer)) . words <$> getLine

  let
    xs' = array (0,n) ((0,sum' xs) : [(i, f $ xs'!(i-1) - xs!!(i-1)) | i<-[1..n] ]) :: Array Int Integer
    ys' = array (0,m) ((0,sum' ys) : [(i, f $ ys'!(i-1) - ys!!(i-1)) | i<-[1..m] ]) :: Array Int Integer

  let x = g [xs'!(i+1) - (fromIntegral (n - (i+1))) * (xs!!i) | i<-[0..n-1]]
  let y = g [ys'!(i+1) - (fromIntegral (m - (i+1))) * (ys!!i) | i<-[0..m-1]]

  print $ mod (x * y) (10^9+7)
  where
    f n = mod n (10^9+7)
    g [] = 0
    g (x:xs) = f $! x + g xs
    sum' = foldl' (+) 0