
import numpy as np

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

x_n = np.array([int(e) for e in input().split()])
y_n = np.array([int(e) for e in input().split()])


x_sum = 0
for i in range(0, n):
    x_sum += i*x_n[i] - (n-i-1)*x_n[i]

y_sum = 0
for i in range(0, m):
    y_sum += i*y_n[i] - (m-i-1)*y_n[i]

print(x_sum * y_sum % (1000000007))
