#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define INF 2100000000
#define MOD 1000000007

int main(){
  ll n,m;
  cin>>n>>m;
  vector<ll> x(n),y(m);
  for(int i=0;i<n;i++){
    cin>>x.at(i);
  }
  for(int i=0;i<m;i++){
    cin>>y.at(i);
  }
  ll X=0;
  ll Y=0;
  for(ll i=0;i<n-1;i++){
    X+=(i+1)*(n-i-1)%MOD*(x.at(i+1)-x.at(i))%MOD;
    X%=MOD;
  }
  for(ll i=0;i<m-1;i++){
    Y+=(i+1)*(m-i-1)%MOD*(y.at(i+1)-y.at(i))%MOD;
    Y%=MOD;
  }
  cout<<X*Y%MOD<<endl;
}
