def exe(x, y):
  X = [0] * x
  Y = [0] * y
  for i in range(x):
    X[i] = (i + 1) * (x - i) * a[i] % MOD
  for i in range(y):
    Y[i] = (i + 1) * (y - i) * b[i] % MOD
  print((sum(X) % MOD) * (sum(Y) % MOD) % MOD)
  

n, m = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
MOD = 10 ** 9 + 7
a = [0] * (n - 1)
for i in range(n - 1):
  a[i] = x[i + 1] - x[i]
b = [0] * (n - 1)
for i in range(m - 1):
  b[i] = y[i + 1] - y[i]
exe(n - 1, m - 1)