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