#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;
const int mod=1000000007;

ll x[100001],y[100001];
int main(){
    ll n,m;
    cin>>n>>m;
    rep(i,n) cin>>x[i];
    rep(i,m) cin>>y[i];
    sort(x,x+n);
    sort(y,y+m);
    ll sumx=0,sumy=0;
    FOR(i,1,n) sumx=(sumx+(x[i]-x[i-1])*i%mod*(n-i))%mod;
    FOR(i,1,m) sumy=(sumy+(y[i]-y[i-1])*i%mod*(m-i))%mod;
    cout<<sumx*sumy%mod<<endl;
    return 0;
}