#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007

vector<ll> X(100010), Y(100010);

int main() {
	ll N, M;
	cin >> N >> M;

	ll xal = 0, yal = 0;
	for (ll i = 0;i < N;i++) {
		cin >> X[i];
		if (i) {
			xal += (X[i] - X[i - 1])*(i*(N - i) % MOD);
			xal %= MOD;
		}
	}
	for (ll i = 0;i < M;i++) {
		cin >> Y[i];
		if (i) {
			yal += ((Y[i] - Y[i - 1])*xal%MOD)*(i*(M - i) % MOD);
			yal %= MOD;
		}
	}
	cout << yal << endl;
}