
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef struct pair<int,int> P;
typedef long long ll;
bool k[100001]={};
ll x[100001];
ll y[100001];
int main() {
	ll n,m;
	cin>>n>>m;
	ll tx=0;
	ll ty=0;
	for(int i=0;i<n;++i){
		cin>>x[i];
		tx+=x[i];
	}
	for(int i=0;i<m;++i){
		cin>>y[i];
		ty+=y[i];
	}

	ll a=0;
	for(int i=0;i<n-1;++i){
		tx-=x[i];
		a=(a+tx-x[i]*(n-i-1))%1000000007;
	}
	ll b=0;
	for(int i=0;i<m-1;++i){
		ty-=y[i];
		b=(b+ty-y[i]*(m-i-1))%1000000007;
	}
	ll s=(a*b)%1000000007;
	cout<<s<<endl;
	return 0;
}
