local n,m = io.read("*n", "*n")
local xsum, ysum=0, 0
for i=0,n-1 do
  local x=io.read("*n")
  xsum = xsum + x*(i-(n-1-i))
end
for i=0,m-1 do
  local y=io.read("*n")
  ysum = ysum + y*(i-(m-1-i))
end
xsum=xsum%(1e9+7)
ysum=ysum%(1e9+7)
print(math.floor(xsum*ysum%(1e9+7)))