#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define pb push_back
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int n,m;
	cin>>n>>m;
	ll x[m],y[n];
	for(int i = 0; i<n; i++)
		cin>>y[i];
	for(int i = 0; i<m; i++)
		cin>>x[i];
	ll ans = 0, ans2 = 0;
	for(int i= 0; i<n; i++)
		ans = (ans + i*y[i]-(n-i-1)*y[i])%mod;
	for(int i= 0; i<m; i++)
		ans2 = (ans2 + i*x[i]-(m-i-1)*x[i])%mod;
	cout<<ans*ans2%mod<<endl;
	return 0;
}