parseInt(x) = parse(Int, x)

function main()
	n,m = map(parseInt, split(readline()))
	x = map(parseInt, split(readline()))
	y = map(parseInt, split(readline()))
	sx = 0
	sy = 0
	for k in 1:n
		sx += (k-1)*x[k]%1000000007 - (n-k)*x[k]%1000000007
	end
    for k in 1:m
		sy += (k-1)*y[k]%1000000007 - (m-k)*y[k]%1000000007
    end
	println((sx%1000000007)*(sy%1000000007)%1000000007)
end

main()