# -*- coding: utf-8 -*-

n, m = input().split()
x = input().split()
y = input().split()
width = []
for i in range(len(x)-1):
    for j in range(i+1,len(x)):
        width.append(abs(int(x[i])-int(x[j])))

height = []
for i in range(len(y)-1):
    for j in range(i+1,len(y)):
        height.append(abs(int(y[i])-int(y[j])))

sum = 0
for w in width:
    for h in height:
        sum = sum + w * h
print(sum % (10 ** 9 + 7))