chomp($_ = <>);
@b = split(' ', $_);

for ($i = 0; $i < $n-1; ++$i) {
    $suma += mult(($a[$i+1]-$a[$i]) , ($n - ($i+1)) , ($i+1));
    $suma %= 1000000007;
}
for ($i = 0; $i < $m-1;  ++$i) {
    $sumb += mult(($b[$i+1]-$b[$i]) , ($m - ($i+1)) , ($i+1));
    $sumb %= 1000000007;
}
printf("%d\n", mult($suma, $sumb));

sub mult {
    my(@a) = @_;
    my $x = shift(@a);

    for (@a) {
        $x *= $_;
        $x %= 1000000007;
    }
    return $x;
}
