#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;

ll inf=1ll<<60,mod=1e9+7;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(0);
	ll n,m,i,s1=0,s2=0,t;
	cin>>n>>m;
	for (i=1;i<=n;i++){
		cin>>t;
		s1=(s1+(i-1)*t-(n-i)*t)%mod;
	}
	for (i=1;i<=m;i++){
		cin>>t;
		s2=(s2+(i-1)*t-(m-i)*t)%mod;
	}
	cout<<(s1*s2)%mod;
	return 0;
}