#include <iostream>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
const ll MOD = (ll)(1e9) + 7;

int main() {
	int n, m; scanf("%d %d", &n, &m);
	ll a = 0, b = 0;
	rep(i,n) {
		ll x; scanf("%lld", &x);
		(a += x * (i + i - n + 1)) %= MOD;
	}
	rep(i,m) {
		ll y; scanf("%lld", &y);
		(b += y * (i + i - m + 1)) %= MOD;
	}
	printf("%lld\n", a * b % MOD);
}