#include <iostream>
#include <vector>
using namespace std;

#define MOD_N    1000000007
typedef long long ll;

int N, M;
vector<int> X, Y;


int main(void) {
	ll xx, yy, ans;

	cin >> N >> M;
	X.resize(N);
	Y.resize(M);
	for (int i = 0; i < N; ++i)
		cin >> X[i];
	for (int j = 0; j < M; ++j)
		cin >> Y[j];
	xx = 0;
	for (int k = 0; k < N; ++k) {
		xx += (ll)k * X[k] - (ll)(N - k - 1) * X[k];
		xx %= MOD_N;
	}
	yy = 0;
	for (int k = 0; k < M; ++k) {
		yy += (ll)k * Y[k] - (ll)(M - k - 1) * Y[k];
		yy %= MOD_N;
	}
	ans = (xx * yy) % MOD_N;

	cout << ans << '\n';
	return 0;
}
