#include<cstdio>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main(){
	int n, m; scanf("%d %d", &n, &m);
	ll x[100000], y[100000];
	for(int i = 0; i < n; i++) scanf("%lld", &x[i]);
	for(int i = 0; i < m; i++) scanf("%lld", &y[i]);
	ll s = 0, t = 0;
	for(int i = 1; i <= n; i++) s += (2 * i - n - 1) * x[i - 1];
	for(int i = 1; i <= m; i++) t += (2 * i - m - 1) * y[i - 1];
	s %= MOD; t %= MOD;
	ll res = s * t % MOD;
	printf("%lld\n", res);
	return 0;
}