#include<iostream>
#include<algorithm>
#define Maxn 100005
using namespace std;
const int N=1e9+7;
bool Cmp(int a,int b){
    return a>b;
}
int main(){
    long long x[Maxn],y[Maxn],n,m,sumx=0,sumy=0;
    cin>>n>>m;
    for(int i=0;i<n;i++)
        cin>>x[i];
    for(int i=0;i<m;i++)
        cin>>y[i];
    sort(x,x+n,Cmp);
    sort(y,y+m,Cmp);
    for(int i=0;i<=n-1;i++){
        sumx=(sumx+(x[i]-x[i+1])*(n-1-i)*(i+1))%N;
 
    }
    for(int i=0;i<=m-1;i++){
        sumy=(sumy+(y[i]-y[i+1])*(m-1-i)*(i+1))%N;
    }
    cout<<sumx*sumy%N<<endl;
    return 0;
}