#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
const int mod=1e9+7;
int32_t main()
{
	int n,m;
	cin>>n>>m;
	int x[n+1];
	int y[m+1];
	for(int i=1;i<=n;i++)cin>>x[i];
	for(int j=1;j<=m;j++)cin>>y[j];
	
	//ith element added i-1 times
	//subtracted n-i times
	int xs=0,ys=0;
	for(int i=1;i<=n;i++)
	{
		xs+=(((i-1)*x[i])%mod - ((n-i)*x[i])%mod + 2*mod)%mod;
		xs%=mod;
	}
	for(int i=1;i<=m;i++)
	{
		ys+=(((i-1)*y[i])%mod - ((m-i)*y[i])%mod + 2*mod)%mod;
		ys%=mod;
	}
	
	cout<<(ys*xs)%mod;
	
	
	
}