n,m=[int(x) for x in input().split()]
X=[int(x) for x in input().split()]
Y=[int(x) for x in input().split()]
from itertools import product,combinations
mod=10**9+7
ans=0
for x,y in product(combinations(X,2),combinations(Y,2)):
    ans=(ans+(x[1]-x[0])*(y[1]-y[0]))%mod
print(ans)