import Data.List

q = 10^9+7

main = do
 [n,m] <- map read . words <$> getLine
 xs <- map read . words <$> getLine
 ys <- map read . words <$> getLine
 print (ttt n m xs ys)

ttt :: Integer -> Integer -> [Integer] -> [Integer] -> Integer
ttt n m xs ys = mod (adxs * adxy) q
 where
  adxs = foldl' (\acc (k,dx) -> acc + ((k-1)*dx - (n-k)*dx)) 0 idxs
  adxy = foldl' (\acc (k,dy) -> acc + ((k-1)*dy - (n-k)*dy)) 0 idys
  idxs = zip [1..n] xs
  idys = zip [1..m] ys
