import os
import sys

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

MOD = 10 ** 9 + 7

N, M = list(map(int, sys.stdin.readline().split()))
X = list(map(int, sys.stdin.readline().split()))
Y = list(map(int, sys.stdin.readline().split()))


def ModInt(mod):
    class _ModInt:
        def __init__(self, value):
            self.value = value % mod

        def __add__(self, other):
            return _ModInt(self.value + other.value)

        def __mul__(self, other):
            return _ModInt(self.value * other.value)

        def __repr__(self):
            return str(self.value)

    return _ModInt


MI = ModInt(MOD)
X = np.diff(X)
Y = np.diff(Y)
X = np.array([MI(x) for x in X])
Y = np.array([MI(y) for y in Y])

#  あるエリアが何回カウントされるか
xc = np.cumsum([MI(x) for x in range(len(X), -len(X), -2)])
yc = np.cumsum([MI(y) for y in range(len(Y), -len(Y), -2)])

print(np.dot(X, xc) * np.dot(Y, yc))
