#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 100005
#define INF 1000000005LL
#define MOD 1000000007

using namespace std;
typedef long long ll;
typedef pair <int,int> P;

ll n,m;
ll x[SIZE],y[SIZE];

int main()
{
	cin >> n >> m;
	rep(i,0,n)cin >> x[i];
	rep(i,0,m)cin >> y[i];
	ll s = 0;
	rep(i,1,n) {
		ll u = (x[i]-x[i-1])*i%MOD;
		(u *= (n-i)) %= MOD;
		(s += u) %= MOD;
	}
	ll t = 0;
	rep(i,1,m) {
		ll u = i*(m-i)%MOD;
		(u *= (y[i]-y[i-1])) %= MOD;
		t += u;
		t %= MOD;
	}
	(s *= t) %= MOD;
	cout << s << endl;

	return 0;
}
