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

int main() {
	const ll MOD = 1e9 + 7;
	int n, m;
	cin >> n >> m;
	vector<ll> x(n + 1);
	vector<ll> y(m + 1);
	for (int i = 1; i <= n; i++) cin >> x[i];
	for (int i = 1; i <= m; i++) cin >> y[i];

	ll sum_x = 0, sum_y = 0;
	for (int i = 1; i <= n; i++) {
		ll tmp = (i - 1) * x[i] - (n - i) * x[i];
		sum_x = (sum_x + (tmp + MOD) % MOD) % MOD;
	}
	for (int i = 1; i <= m; i++) {
		ll tmp = (i - 1) * y[i] - (m - i) * y[i];
		sum_y = (sum_y + (tmp + MOD) % MOD) % MOD;
	}

	ll res = (sum_x * sum_y) % MOD;
	cout << res << endl;

	return 0;
}
