main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  xs <- map read . words <$> getLine
  ys <- map read . words <$> getLine
  let
    f n (k, xk)=
      fromIntegral $ (k-1)*xk - (n-k)*xk
    xsum = sum . map (f n) $ zip [1..] xs
    ysum = sum . map (f m) $ zip [1..] ys
  print $ xsum * ysum `mod` 1000000007