object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val x = List.fill(n)(sc.nextLong())
  val y = List.fill(m)(sc.nextLong())

  val mod = 1000000007

  def plus(a: Long, b: Long): Long = (a + b) % mod
  def times(a: Long, b: Long): Long = (a * b) % mod

  val c = x.sliding(2).map{
    case List(x1, x2) => x2 - x1
  }.zipWithIndex.map{
    case (e, idx) => times(times(e, idx+1), n-idx-1)
  }.reduceLeft(plus)

  val d = y.sliding(2).map{
    case List(y1, y2) => y2 - y1
  }.zipWithIndex.map{
    case (e, idx) => times(times(e, idx+1), m-idx-1)
  }.reduceLeft(plus)

  println(times(c, d))
}
