import io.StdIn.readLine
object Main extends App {
  val mod = 1000000007
  val Array(n, m) = readLine.split(" ").map(_.toInt)
  val xs = readLine.split(" ").toSeq.map(_.toLong)
  val ys = readLine.split(" ").toSeq.map(_.toLong)
  val lx = (for (i <- 0 until n) yield xs(i) * (2 * i - n + 1)).reduce((a, b) => (a + b) % mod)
  val ly = (for (j <- 0 until m) yield ys(j) * (2 * j - m + 1)).reduce((a, b) => (a + b) % mod)
  println(lx * ly % mod)
}
