import Data.Array
import Data.List
import Data.Int

divisor = 10^9+7

main = do
  (n:m:_) <- getLine >>= return . map read . words :: IO [Integer]
  xs <- getLine >>= return . map read . words :: IO [Integer]
  ys <- getLine >>= return . map read . words :: IO [Integer]

  let
    xs' = array (0,n-1) (zip [0..] xs)
    ys' = array (0,n-1) (zip [0..] ys)
    
    x = foldl1 (\x y -> (x+y) `mod` divisor) $ map (\i -> mod ((xs'!(fromIntegral $ n - 1 - i) - xs'!(fromIntegral i)) * (n -1 - 2*i)) divisor) [0..div (n-1) 2]
    y = foldl1 (\x y -> (x+y) `mod` divisor) $ map (\i -> mod ((ys'!(fromIntegral $ m - 1 - i) - ys'!(fromIntegral i)) * (m -1 - 2*i)) divisor) [0..div (m-1) 2]

  print $ (x * y) `mod` divisor
    
