{-# LANGUAGE TupleSections #-}

main :: IO ()
main = do
    _ <- getLine
    xs <- getInts
    ys <- getInts
    print $ solve xs ys

solve :: [Int] -> [Int] -> Int
solve xs ys = (calc xs * calc ys) `mod` lim

calc :: [Int] -> Int
calc xs = getSum . foldMap (\(i,x) -> Sum $ (2*i-1-n)*x) $ zip [1..] xs
    where n = length xs

newtype Sum = Sum { getSum :: Int }

instance Monoid Sum where
    mempty = Sum 0
    mappend (Sum x) (Sum y) = Sum $ (x+y) `mod` lim

lim :: Int
lim = 7 + 10^9

getInts :: IO [Int]
getInts = map read . words <$> getLine
