import itertools


def solve():
    N, M = map(int, input().split())

    Xi = list(map(int, input().split()))
    Yi = list(map(int, input().split()))

    comb = list(itertools.combinations(Xi, 2))

    xs = list(map(lambda x: abs(x[0] - x[1]), comb))

    comb = list(itertools.combinations(Yi, 2))

    ys = list(map(lambda x: abs(x[0] - x[1]), comb))

    ans = 0
    for x in xs:
        for y in ys:
            ans += x * y

    return ans % (10**9 + 7)


if __name__ == '__main__':
    res = solve()
    print(res)
