n,m=map(int,input().split())
*x,=map(int,input().split())
*y,=map(int,input().split())

sum_x,sum_y=[0]*(n-1),[0]*(m-1)
sum_x[0]=x[1]-x[0]
sum_y[0]=y[1]-y[0]
mod=10**9+7

for i in range(1,n-1):
    sum_x[i]=sum_x[i-1]+x[i+1]-x[i]+x[i+1]-x[0]
for i in range(1,m-1):
    sum_y[i]=sum_y[i-1]+y[i+1]-y[i]+y[i+1]-y[0]

print((sum_x[-1]*sum_y[-1])%mod)
