n, m = map(int, raw_input().split())
x = map(int, raw_input().split())
y = map(int, raw_input().split())

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

print(result % (10**9 + 7))