# D - 井井井 / ###
# 問題URL:http://abc058.contest.atcoder.jp/tasks/arc071_b

n , m = map(int, input().split())
X = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]

x_sum = 0
y_sum =0

for i in range(1,n+1):
    x_sum += (X[i-1] * (i - 1)) - (X[i-1] * (n - i))
    
for i in range(1,m+1):
    y_sum += (Y[i-1] * (i - 1)) - (Y[i-1] * (m - i))

print((x_sum * y_sum)%1000000007)