N,M=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
mod=10**9+7
x=0
for i in range(N):
    x+=((i-(N-i-1))*X[i])%mod
    x%=mod
y=0
for j in range(M):
    y+=((j-(M-j-1))*Y[j])%mod
    y%=mod
print((x*y)%mod)