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

lxs = Xs.sort.combination(2).map{|a, b| b - a}
lys = Ys.sort.combination(2).map{|a, b| b - a}
puts lxs.product(lys).inject(0){|s, (x, y)| (s + x*y) % 1000000007}