n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
mod = 10 ** 9 + 7

sum_x = 0
sum_y = 0

for i in range(n):
    sum_x += (2 * i + 1 - n) * x[i] % mod
for j in range(m):
    sum_y += (2 * j + 1 - m) * y[j] % mod

print((sum_x * sum_y) % mod)
