#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define range(a) (a).begin(),(a).end()
#define print(A,n) rep(i,0,n){cout<<(i ? " ":"")<<A[i];}cout<<endl;
#define pprint(A,m,n) rep(j,0,m){print(A[j],n);}
const long mod=1e9+7;
const int size=1e5;
const int INF=1e9;
int main(){
	int n,m;cin>>n>>m;
	long X[n],Y[m];
	rep(i,0,n) cin>>X[i];
	rep(i,0,m) cin>>Y[i];
	long a=0,b=0;
	rep(i,0,n){ a+=(n-1-2*i)*X[i];a%=mod; }
	rep(i,0,m){ b+=(m-1-2*i)*Y[i];b%=mod; }
	long ans=(a*b)%mod;
	cout<<(ans+mod)%mod<<endl;
}