#include <iostream>
#include <cstdio>
#define int long long
using namespace std;

const int mod = 1e9 + 7;
int x[100005], y[100005];
signed main() {
	int n, m;
	scanf("%lld%lld", &n, &m);
	for (int i = 0; i < n; i++)
		scanf("%lld", x + i);
	for (int i = 0; i < m; i++)
		scanf("%lld", y + i);
	int W = 0, H = 0;
	for (int l = 0, r = n - 1; l < r; l++, r--)
		W = (W + (x[r] - x[l]) * (r - l)) % mod;
	for (int l = 0, r = m - 1; l < r; l++, r--)
		H = (H + (y[r] - y[l]) * (r - l)) % mod;
	printf("%lld\n", (W * H) % mod);
	return 0;
}