if __FILE__==$0
	rl_i=lambda{|str,dl|str.strip.split(dl).map(&:to_i)}
	n,m=rl_i[gets," "]
	px=rl_i[gets," "]
	py=rl_i[gets," "]
	wx=[]
	wy=[]
	mod=1000000007
	for i in 0..px.length-1
		for j in i+1..px.length-1
			wx.push(px[j]-px[i])
		end
	end
	for i in 0..py.length-1
		for j in i+1..py.length-1
			wy.push(py[j]-py[i])
		end
	end
	s=0
	for x in wx
		for y in wy
			s+=x*y
		end
	end
	p s%mod
end