#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll MOD = 1000000007;
int main() {
	ll n, m;
	cin >> n >> m;
	ll x[n + 1], y[m + 1];
	ll sum_x = 0, sum_y = 0;
	for (ll i = 0; i < n; i++) {
		cin >> x[i];
		sum_x += x[i] * (2 * i - n + 1);
	}
	for (ll i = 0; i < m; i++) {
		cin >> y[i];
		sum_y += y[i] * (2 * i - m + 1);
	}
	cout << ((sum_x%MOD)*(sum_y%MOD)) % MOD << endl;
}
