package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	m := getNextInt(scanner)
	xx := make([]int64, n)
	yy := make([]int64, m)
	for i := 0; i < n; i++ {
		xx[i] = getNextInt64(scanner)
	}

	for i := 0; i < m; i++ {
		yy[i] = getNextInt64(scanner)
	}

	var ans, unitx, mod int64
	mod = int64(1e9 + 7)

	for i := 0; i < n-1; i++ {
		unitx += int64(i+1) * int64(n-(i+1)) * (xx[i+1] - xx[i])
		unitx %= mod
	}

	for i := 0; i < m-1; i++ {
		ans += int64(i+1) * int64(m-(i+1)) * (yy[i+1] - yy[i]) * unitx
		ans %= mod
	}

	fmt.Fprintln(writer, ans)
	writer.Flush()
}
