n, m = input().split()
n = int(n)
m = int(m)
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]

def sum(a, n):
    sum_a = 0
    for i in range(0, n):
        sum_a += i * a[i] - (n-1-i) * a[i]
    return sum_a

sum_x = sum(x,n)
sum_y = sum(y,m)

s = sum_x * sum_y % (10**9 + 7)

print(s)