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

import sys
import os
import math


n, m = list(map(int, input().split()))
X = list(map(int, input().split()))
Y = list(map(int, input().split()))

def sum_len(A):
    all = 0
    for i in range(len(A)):
        for j in range(i+1, len(A)):
            l = A[j] - A[i]
            all += l
    return all

a = 10**9 + 7
xl = sum_len(X)
yl = sum_len(Y)
print(xl * yl % a)