#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

template <class T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
	for (const auto& e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& st) {
	for (const auto& e : st) os << e << " ";
	return os;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const map<T1, T2>& mp) {
	for (const auto& e : mp) os << e << " ";
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T&& h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head&& h, Tail&&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

/*使い方
Factorial f;//Factorialクラスのaを作成　

（※デフォルトで110000が入っているが、もっと大きいnで計算したい場合
Factorial f(1000000);
などと置く必要がある）

Int b = f.Pmod(5, 2);//nPkを計算 → 20を出力
Int c = f.Cmod(5, 2);//nCkを計算 → 10を出力
Int d = f.Pmod(5, 5);//n!を計算 → 120を出力

*/
class Factorial {
private:
	vector<Int> fac, inv, finv;

	void build(Int N) {
		fac[0] = fac[1] = 1; inv[1] = 1; finv[0] = finv[1] = 1;

		for (Int i = 2; i < N; i++) {
			fac[i] = fac[i - 1] * i % MOD;
			inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
			finv[i] = finv[i - 1] * inv[i] % MOD;
		}
	}

public:
	Factorial(Int N = 110000) : fac(N + 1), inv(N + 1), finv(N + 1) { build(N + 1); }

	//nCkの計算
	Int Cmod(Int n, Int k) {
		if (n < k || k < 0) return 0LL;
		return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
	}

	//nPkの計算
	Int Pmod(Int n, Int k) {
		if (n < k || k < 0) return 0LL;
		return fac[n] * finv[n - k] % MOD;
	}
};

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int n, m;
	cin >> n >> m;

	vector<Int> x(n);
	vector<Int> y(m);

	for (Int i = 0; i < n; i++) {
		cin >> x[i];
	}
	for (Int i = 0; i < m; i++) {
		cin >> y[i];
	}

	mint ans = 0;
	mint temp;
	Factorial f;

	for (Int i = 0; i < m-1; i++) {
		for (Int j = 0; j < n-1; j++) {
			temp = f.Cmod(m, 2) * f.Cmod(n, 2);
			temp -= f.Cmod(n - j - 1, 2) * f.Cmod(m, 2) + f.Cmod(j + 1, 2) * f.Cmod(m, 2) + f.Cmod(m - i - 1, 2) * f.Cmod(n, 2) + f.Cmod(i + 1, 2) * f.Cmod(n, 2);
			temp += f.Cmod(n - j - 1, 2) * f.Cmod(m - i - 1, 2) + f.Cmod(n - j - 1, 2) * f.Cmod(i + 1, 2) + f.Cmod(i + 1, 2) * f.Cmod(j + 1, 2) + f.Cmod(j + 1, 2) * f.Cmod(m - i - 1, 2);
			temp *= x[j + 1] - x[j];
			temp *= y[i + 1] - y[i];
			ans += temp;
		}
	}

	cout << ans << "\n";

}
