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

X=0
Y=0
for i in range(0,n):
    for j in range(i+1,n):
        X+=x[j]-x[i]
        
for i in range(0,m):
    for j in range(i+1,m):
        Y+=y[j]-y[i]
        
mod=10**9+7
print(X*Y%mod)