N, M = gets.split.map(&:to_i)
Xs, Ys = readlines.map{|l| l.split.map(&:to_i)}
MOD = 1000000007

lxs = Xs.sort.combination(2).map{|a, b| b - a}.inject(:+) % MOD
lys = Ys.sort.combination(2).map{|a, b| b - a}.inject(:+) % MOD

puts lxs * lys % MOD