#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007

int main() {
	int n,m; cin >> n >> m;
	long long sumx=0,sumy=0;
	for(int i=0;i<n;++i) {
		long long x; cin >> x;
		(sumx+=i*x)%=MOD;
		(sumx-=(n-i-1)*x)%=MOD;
	}
	for(int i=0;i<m;++i) {
		long long y; cin >> y;
		(sumy+=i*y)%=MOD;
		(sumy-=(m-i-1)*y)%=MOD;
	}
	int ans = (sumx*sumy%MOD+MOD)%MOD;
	cout << ans << endl;
	
	return 0;
}