#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
  long n,m,i,j,x[100010],y[100010],g=0,ans=0;
  const long mod=1e9+7;
  cin >> n >> m;
  for (i=0;i<n;i++) cin >> x[i];
  for (j=0;j<m;j++) cin >> y[j];
  for (i=0;i<n-1;i++) g=(g+(x[i+1]-x[i])*(i+1)*(n-i-1))%mod;
  for (j=0;j<m-1;j++) ans=(ans+(g*(y[j+1]-y[j]))%mod*(j+1)*(m-j-1))%mod;
  cout << ans << endl;
  return 0;
}