n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
ax = sum([(2*i - n + 1)*x[i] for i in range(n)])
ay = sum([(2*i - m + 1)*y[i] for i in range(m)])
print((ax*ay)%(10**9+7))
