n, m = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))

total = 0
for l in range(len(y)-1):
	for k in range(len(x)-1):
		for i in range(k+1,len(x)):
			for j in range(l+1,len(y)):
				total += (abs(x[i]-x[k])*abs(y[j]-y[l]))%1000000007
				total %= 1000000007

print(total%1000000007)