n,m=input().split()
x=input().split()
y=input().split()
d=pow(10,9)+7

i=0
k=0
S=0
while i<int(n)-1:
	i+=1
	S+=i*(int(n)-i)*(int(x[i])-int(x[i-1]))*(int(y[int(n)-1])-int(y[0]))
while k<int(m)-1:
	k+=1
	S+=k*(int(m)-k)*(int(y[k])-int(y[k-1]))*(int(x[int(m)-1])-int(x[0]))
A=S%d
print(A)