#include <bits/stdc++.h>
using namespace std;

#define MOD (1000000000+7)
#define MAX 100000

long long n, m;
long long x[MAX];
long long y[MAX];

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

	long long xsum = 0;
	for( int i = 0; i < n; i++ ) {
		xsum = ( xsum + ( i * x[i] - (n - i - 1) * x[i] + MOD ) % MOD ) % MOD;
	}
	long long ysum = 0;
	for( int i = 0; i < m; i++ ) {
		ysum = ( ysum + ( i * y[i] - (m - i - 1) * y[i]  + MOD ) % MOD ) % MOD;
	}
	long long ans = xsum * ysum % MOD;

	cout << ans << endl;

	return 0;
}
