
package main

import "fmt"

func main() {
  var n, m int
  const q = uint64(1000000007)

  fmt.Scanf("%d %d", &n, &m)
  xs := make([]int64, n)
  ys := make([]int64, m)
  for i := 0; i < n; i++ {
    fmt.Scanf("%d", &(xs[i]))
  }
  for i := 0; i < m; i++ {
    fmt.Scanf("%d", &(ys[i]))
  }

  xsum := uint64(0)
  for i := 0; i < n-1; i++ {
    for j := i+1; j < n; j++ {
      xsum = (xsum + uint64(xs[j]-xs[i])) % q
    }
  }
  ysum := uint64(0)
  for i := 0; i < m-1; i++ {
    for j := i+1; j < m; j++ {
      ysum = (ysum + uint64(ys[j]-ys[i])) % q
    }
  }

  sum := (xsum * ysum) % q

  fmt.Println(sum)
}
