#include <bits/stdc++.h>
#define int long long
using namespace std;
const int mod=1e9+7;
int n,m,x[100009],y[100009],xsum,ysum;
signed main(){
    cin>>n>>m;
    for(int i=0;i<n;i++){
        cin>>x[i];
        if(i)(xsum+=(x[i]-x[i-1])*i*(n-i))%=mod;
    }for(int i=0;i<m;i++){
        cin>>y[i];
        if(i)(ysum+=(y[i]-y[i-1])*i*(m-i))%=mod;
    }cout<<xsum*ysum%mod<<endl;
}