import java.io.{BufferedReader, InputStream, InputStreamReader}
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.{abs, max, min}

object Main {
  val MOD = 1000000007
  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val N = sc.nextInt()
    val M = sc.nextInt()
    val x = Array.fill[Long](N)(sc.nextLong())
    val y = Array.fill[Long](M)(sc.nextLong())
    Sorting.quickSort(x)
    Sorting.quickSort(y)

    def p(x: Long, y: Long) = (x + y) % MOD
    def m(x: Long, y: Long) = x * y % MOD
    
    def sigma(a: Array[Long]): Long = {
      var sum: Long = 0
      val n = a.length
      a.indices foreach { i =>
        val j = if (i * 2 < n) i else n - 1 - i
        val c = p(m(j+1, n), -1 * m(j + 1, j)) // // 回数: (i+1)*n - i(i+1)
        sum = p(sum, m(c, a(i)))
      }
      sum
    }

    def diff(a: Array[Long]): Array[Long] = {
      (a zip a.drop(1)) map { case (x1, x2) => x2 - x1 }
    }

    val sigmaX = sigma(diff(x))
    val sigmaY = sigma(diff(y))

    println(m(sigmaX, sigmaY))
  }


  def main(args: Array[String]): Unit = {
    solve()
  }


  private class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = null

    def next: String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next.toInt
    def nextLong(): Long = next.toLong
    def nextChar(): Char = next.charAt(0)
  }

}
