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

a, b = 0, 0
for i in range(n):
    a += x[i]*i - x[i]*(n-i-1)
for i in range(m):
    b += y[i]*i - y[i]*(m-i-1)

print(a * b % mod)