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