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

X=[]
for i in range(1,n):
    X.append(x[i]-x[i-1])
    
Y=[]
for j in range(1,m):
    Y.append(y[j]-y[j-1])

X1=[len(X) for i in range(len(X))]
for k in range(1,int(len(X)/2)+1):
    X1[k]=X1[k-1]+(len(X)-2*k)
    X1[len(X)-k-1]=X1[k-1]+(len(X)-2*k)
#print(X1)
    
Y1=[len(Y) for i in range(len(Y))]
for l in range(1,int(len(Y)/2)):
    Y1[l]=Y1[l-1]+(len(Y)-2*l)
    Y1[len(Y)-l-1]=Y1[l-1]+(len(Y)-2*l)
#print(Y1)

i=0
j=0
X2=[]
for i in range(len(X1)):
    X2.append(X[i]*X1[i])
Y2=[]
for j in range(len(Y1)):
    Y2.append(Y[j]*Y1[j])
    
print(sum(X2)%(10**9+7)*sum(Y2)%(10**9+7))