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

long long INF = 1e18;
long long MOD = 1e9+7;

int main() {
	int m, n;	cin>>m>>n;
	
	long long temp;
	long long sumX = 0;
	for (int i = 1; i <= m; ++i) {
		cin>>temp;
		sumX = (sumX + (2*i-m-1) * temp % MOD) % MOD;
	}
	
	long long sumY = 0;
	for (int j = 1; j <= n; ++j) {
		cin>>temp;
		sumY = (sumY + (2*j-n-1) * temp % MOD) % MOD;
	}
	
	long long res = sumX * sumY % MOD;
	cout<<res<<endl;
	
	return 0;
}