DIVISOR = 10**9+7
N, M = gets.split(" ").first(2).map(&:to_i)
Xa = gets.split(" ").first(N).map(&:to_i).reverse
Ya = gets.split(" ").first(M).map(&:to_i).reverse

total = 0
Xa.combination(2).each{|x1, x2|
  Ya.combination(2).each{|y1, y2|
    w = x1-x2
    h = y1-y2
    total += w*h
  }
  total %= DIVISOR
}
puts total