n,m=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
mod=10**9+7

X.sort()
Y.sort()

x=0
y=0
for i in range(1,n):
    x=(x+(X[i]-X[i-1])*i*(n-i))%mod

for i in range(1,m):
    y=(y+(Y[i]-Y[i-1])*i*(m-i))%mod

print(x*y%mod)