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

Y = 0
for i in range(1, m + 1):
    Y += (i - 1) * y[i - 1] - (m - i) * y[i - 1]
    Y %= mod

X = 0
for i in range(1, n + 1):
    X += (i - 1) * x[i - 1] - (n - i) * x[i - 1]
    X %= mod

print(X * Y % mod)
