#include <iostream>
using namespace std;

int main()
{
	int n, m; cin >> n >> m;
	long long x[n], y[m];

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

	const long long mod = 1000000007;


	/* compute sigma_{1<=i<j<=n}(x_j - x_i) */
	long long sum_x = 0;
	for(int k = 0; k < n; k++){
		sum_x += (k * x[k] - (n - k - 1) * x[k]) % mod;
	}
	long long sum_y = 0;
	for(int k = 0; k < m; k++){
		sum_y += (k * y[k] - (m - k - 1) * y[k]) % mod;
	}

	cout << ((sum_x % mod) * (sum_y % mod)) % mod << endl;

	return 0;
}