#include<iostream>
#include<algorithm>
#define MOD 1000000007
using namespace std;
typedef long long ll;
signed main(){
  ll n,m,xsum=0,ysum=0,ans=0;
  cin >> n >> m;
  ll tx[n],ty[m],x[n],y[m];
  for(ll i=0;i<n;i++){
    cin >> tx[i];
  }
  for(ll i=0;i<m;i++){
    cin >> ty[i];
  }
  sort(tx,tx+n);
  sort(ty,ty+m);
  n--; m--;
  for(ll i=0;i<n;i++){
    x[i]=tx[i+1]-tx[i];
    x[i]%=MOD;
  }
  for(ll i=0;i<m;i++){
    y[i]=ty[i+1]-ty[i];
    y[i]%=MOD;
  }
  for(ll i=0;i<n;i++){
    if(i==0||i==n-1){
      xsum+=x[i]*n;
    }else{
      xsum+=((((i+1)*(n-i))%MOD)*x[i])%MOD;
    }
    xsum%=MOD;
  }
  for(ll i=0;i<m;i++){
    if(i==0||i==m-1){
      ysum+=y[i]*m;
    }else{
      ysum+=((((i+1)*(m-i))%MOD)*y[i])%MOD;
    }
    ysum%=MOD;
  }
  ans = xsum*ysum;
  ans%=MOD;
  cout << ans<<endl;
}

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=1000000007;
signed main(){
  int n,m,x1,y1;
  cin>>n>>m>>x1;
  int ans1=0,ans2=0;
  for(int i=0;i<n-1;i++){
    int x2;
    cin>>x2;
    ans1=(ans1+(x2-x1)*(i+1)%mod*(n-1-i)%mod)%mod;
    x1=x2;
  }
  cin>>y1;
  for(int i=0;i<m-1;i++){
    int y2;
    cin>>y2;
    ans2=(ans2+(y2-y1)*(i+1)%mod*(m-1-i)%mod)%mod;
    y1=y2;
  }
  cout<<ans1*ans2%mod;
}