s=input()
s=s.split()
n,m=int(s[0]),int(s[1])
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
mod =10**9 + 7
xrange=0
for i in range(n):
    for j in range(i+1,n):
        xrange=xrange+(x[j]-x[i])
yrange=0
for i in range(m):
    for j in range(i+1,m):
        yrange=yrange+(y[j]-y[i])
ans=(xrange*yrange)%mod
print(ans)

