#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

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