import Control.Applicative

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

  let
    f 0 _ = [0]
    f s (x:xs) = (s-x) : f (s-x) xs
    xs' = f (sum xs) xs
    ys' = f (sum ys) ys

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

  print $ mod (x * y) (10^9+7)
