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

X = list(map(int, input().split(" ")))
Y = list(map(int, input().split(" ")))

X_ans = 0
Y_ans = 0

for i in range(n):
    X_ans += ((i-1)-(n-i))*X[i]
    
for j in range(m):
    Y_ans += ((j-1)-(n-j))*Y[j]
        
print((X_ans * Y_ans)%(10**9+7))