a = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
xs = []
ys = []
for i in range(a[0]):
    for j in range(i):
        xs.append(x[i]-x[j])
for i in range(a[1]):
    for j in range(i):
        ys.append(y[i]-y[j])
ans = 0        
for i in xs:
    for j in ys:
        ans += i*j
        ans= ans%((10**9)+7)
print(ans)
        