<?php
define('DIV', 1000000007);

list($n, $m) = array_map('intval', explode(' ', trim(fgets(STDIN))));
$xs = array_map('intval', explode(' ', trim(fgets(STDIN))));
$ys = array_map('intval', explode(' ', trim(fgets(STDIN))));

$lenX = 0;
for ($i = 1; $i < count($xs); $i++) {
    for ($j = 0; $j < $i; $j++) {
        $lenX += $xs[$i] - $xs[$j];
        $lenX = $lenX % DIV;
    }
}

$lenY = 0;
for ($i = 1; $i < count($ys); $i++) {
    for ($j = 0; $j < $i; $j++) {
        $lenY += $ys[$i] - $ys[$j];
        $lenY = $lenY % DIV;
    }
}

echo ($lenX * $lenY) % DIV . "\n";