#include<cstdio>
#include<algorithm>
using namespace std;

typedef long long ll;
const int MAXN = 100010;
const ll MOD = 1000000007;
ll ans, sy, sx;
int x[MAXN], y[MAXN], n, m;

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