#include<bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
int main()
{
	long long n, m;
	cin >> n >> m;
	long long x[n], y[m], h = 0, w = 0;
	for (int i = 1; i <= n; i++) cin >> x[i];
	for (int j = 1; j <= m; j++) cin >> y[j];
	for (int l = 1, r = n; l < r; ++l, --r) w = (w + (x[r] - x[l]) * (r - l) % mod) % mod;
	for (int l = 1, r = m; l < r; ++l, --r) h = (h + (y[r] - y[l]) * (r - l) % mod) % mod;
	cout << h * w % mod;
	return 0;
}