#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  int n,m;
  cin>>n>>m;
  ll a[n];
  rep(i,0,n){
    cin>>a[i];
  }
  ll b[m];
  rep(i,0,m){
    cin>>b[i];
  }
  ll x[n-1];
  rep(i,0,n-1){
    x[i]=a[i+1]-a[i];
  }
  ll y[m-1];
  rep(i,0,m-1){
    y[i]=b[i+1]-b[i];
  }
  ll c=0;
  rep(i,0,n-1){
    c+=x[i]*(i+1)%mod*(n-1-i)%mod;
    c%=mod;
  }
  ll d=0;
  rep(i,0,m-1){
    d+=y[i]*(i+1)%mod*(m-1-i)%mod;
    d%=mod;
  }
  cout<<c*d%mod<<endl;
}