#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#define mod 1000000007
using namespace std;

typedef long long int ll;
int n, m;
ll x, y;


int main(void){
	ll xsum = 0, ysum = 0;
	cin >> n >> m;
	//cout << n << " " << m << endl;
	for(int i = 1; i <= n; i++){
		cin >> x;
		xsum += (-n + 2 * i - 1) * x;
		xsum %= mod;
	}
	for(int i = 1; i <= m; i++){
		cin >> y;
		ysum += (-m + 2 * i - 1) * y;
		ysum %= mod;
	}
	ll ans = (xsum * ysum) % mod;

	cout << ans << endl;

	return 0;
}
