local mod = 1000000007
local mfl = math.floor
local function bmul(x, y)
  local x0, y0 = x % 31623, y % 31623
  local x1, y1 = mfl(x / 31623), mfl(y / 31623)
  return (x1 * y1 * 14122 + (x1 * y0 + x0 * y1) * 31623 + x0 * y0) % mod
end

local function badd(x, y)
  return (x + y) % mod
end

local function bsub(x, y)
  return x < y and x - y + mod or x - y
end

local n, m = io.read("*n", "*n")
local x, y = {}, {}
for i = 1, n do x[i] = io.read("*n") end
for i = 1, m do y[i] = io.read("*n") end

local function solve(t)
  table.sort(t)
  local allsum = 0
  local sum = 0
  for i = 2, #t do
    t[i] = t[i] - t[1]
    sum = badd(sum, t[i])
  end
  t[1] = 0
  allsum = sum
  for i = 2, #t - 1 do
    sum = bsub(sum, bmul(bsub(t[i], t[i - 1]), #t + 1 - i))
    allsum = badd(allsum, sum)
  end
  return allsum
end

print(bmul(solve(x), solve(y)))
