#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;


int main(void){
  int n,m,i;
  ll x[100005]={},y[100005]={},xs,ys;
  const int mod=1e9+7;
  
  cin >> n >> m;
  for (i=0;i<n;i++) cin >> x[i];
  for (i=0;i<m;i++) cin >> y[i];
  
  xs=0;
  for (i=1;i<n;i++) xs=(xs+(x[i]-x[i-1])*i%mod*(n-i)%mod)%mod;
  
  ys=0;
  for (i=1;i<m;i++) ys=(ys+(y[i]-y[i-1])*i%mod*(m-i)%mod)%mod;
  
  cout << xs*ys%mod << endl;
  
  return 0;
}