#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#define ll long long
const int MOD = 1e9 + 7;
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int n, m; cin >> n >> m;
	vector<ll> x(n+1), y(m+1);
	for (int i = 1; i <= n;i++) cin >> x[i];
	for (int i = 1; i <= m; i++) cin >> y[i];
	ll X = 0, Y = 0;
	for (int k = 1; k <= n;k++) {
		X += ((k - 1)*x[k] - (n - k)*x[k]) % MOD;
		X %= MOD;
	}
	for (int k = 1;k <= m;k++) {
		Y += ((k - 1)*y[k] - (m - k)*y[k]) % MOD;
		Y %= MOD;
	}
	ll ans = (X*Y) % MOD;
	cout << ans << endl;
}