// practice with Dukkha
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 100000, M = 100000, MD = 1000000007;

int xx[N], yy[M];

long long solve(int *aa, int n) {
	long long sum = 0, ans = 0;
	for (int i = 0; i < n; i++) {
		ans = (ans + (long long) aa[i] * i - sum) % MD;
		sum += aa[i];
	}
	return ans;
}

int main() {
	int n, m; cin >> n >> m;
	for (int i = 0; i < n; i++)
		cin >> xx[i];
	for (int j = 0; j < m; j++)
		cin >> yy[j];
	cout << solve(xx, n) * solve(yy, m) % MD << '\n';
	return 0;
}
