#include<iostream>
#include<string>
#include<vector>

using namespace std;

#define MOD 1000000007

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
	for (T& x : vec) is >> x;
	return is;
}
int main() {
	int n, m;
	cin >> n >> m;
	vector<long long> a(n);
	vector<long long> b(m);
	cin >> a >> b;
	long long asu = 0, bsu = 0;
	for (int i = 0; i < n; i++)
	{
		asu -= a[i] * (n - i - 1);
		asu += a[i] * i;
	}
	for (int i = 0; i < m; i++)
	{
		bsu -= b[i] * (m - i - 1);
		bsu += b[i] * i;
	}
	long long u = ((asu%MOD)*(bsu%MOD)) % MOD;
	cout << u << endl;
}