N,M = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
modulo = 10**9+7

x,y = 0,0
for i in range(N):
    for j in range(i+1,N):
        x += X[j]-X[i]
for i in range(M):
    for j in range(i+1,M):
        y += Y[j]-Y[i]

print(x*y%modulo)