# D - 井井井 / ###

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



n , m = list(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))
N, M = list(map(int, input().split()))

X = list(map(int, input().split()))

Y = list(map(int, input().split()))

mod = 10 ** 9 + 7



XS = 0

for i, x in enumerate(X, start=1):

    XS += (x * ((i - 1) - (N - i))) % mod

YS = 0

for i, y in enumerate(Y, start=1):

    YS += (y * ((i - 1) - (M - i))) % mod



print((XS * YS % mod))

# D - 井井井 / ###
# 問題URL:http://abc058.contest.atcoder.jp/tasks/arc071_b
n, m = list(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))

N, M = list(map(int, input().split()))
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
mod = 10**9 + 7
XS = 0
for i, x in enumerate(X, start=1):
    XS += (x * ((i - 1) - (N - i))) % mod
YS = 0
for i, y in enumerate(Y, start=1):
    YS += (y * ((i - 1) - (M - i))) % mod
print((XS * YS % mod))

-# D - 井井井 / ### -# 問題URL:http://abc058.contest.atcoder.jp/tasks/arc071_b -n, m = list(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)) +N, M = list(map(int, input().split())) +X = list(map(int, input().split())) +Y = list(map(int, input().split())) +mod = 10**9 + 7 +XS = 0 +for i, x in enumerate(X, start=1): +    XS += (x * ((i - 1) - (N - i))) % mod +YS = 0 +for i, y in enumerate(Y, start=1): +    YS += (y * ((i - 1) - (M - i))) % mod +print((XS * YS % mod))