
package main

import "fmt"

func main() {
  var n, m int

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

  sum := 0
  for i := 0; i < n-1; i++ {
    for j := i+1; j < n; j++ {
      for k := 0; k < m-1; k++ {
        for l := k+1; l < m; l++ {
          sum = sum + ((xs[j]-xs[i])*(ys[l]-ys[k]))
        }
      }
    }
  }

  fmt.Println(sum % (1000000000 + 7))
}
