#include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
typedef long long ll;

const ll mod=1e9+7;

ll zettaiti(ll a){
	return (a>0)?a:-1*a;
}

int main(){
	int n,m;
	cin>>n>>m;
	ll x[n],y[m];
	ll minx=0,miny=0;
	rep(i,n){
		cin>>x[i];
		minx=min(minx,x[i]);
	}
	if(minx<0)rep(i,n)x[i]+=zettaiti(minx);
	rep(i,m){
		cin>>y[i];
		miny=min(miny,y[i]);
	}
	if(miny<0)rep(i,m)y[i]+=zettaiti(miny);
	ll sumx=0,sumy=0;
	rep(i,n)sumx+=(i-(n-i-1))*x[i];
	rep(i,m)sumy+=(i-(m-i-1))*y[i];
	cout<<((sumx%mod)*(sumy%mod))%mod<<endl;
	return 0;
}