#include <iostream>
using namespace std;
typedef long long int lli;

const lli MOD = 1e9 + 7;

int main() {
	int n, m;
	cin >> n >> m;
	lli x[100010], y[100010];
	for (int i = 1;i <= n;i++) { cin >> x[i]; }
	for (int i = 1;i <= m;i++) { cin >> y[i]; }

	lli sumx = 0, sumy = 0;
	//x軸y軸で累積長さをとる
	for (int i = 1;i <= n - 1;i++) {
		sumx = (sumx + i*(((n - i)*(x[i + 1] - x[i]))%MOD)) % MOD;
	}
	for (int i = 1;i <= m - 1;i++) {
		sumy = (sumy + i*(((m - i)*(y[i + 1] - y[i]))%MOD)) % MOD;
	}
	lli ans=0;
	ans = (sumx*sumy) % MOD;
	cout << ans;
}