#include<bits/stdc++.h>
using namespace std;

int main(){
  long n,m,inf = 1000000007;
  cin >> n >> m;
  long x[n+1],y[m+1];
  for(int i = 1;i <= n;i++){
    cin >> x[i];
  }
  for(int i = 1;i <= m;i++){
    cin >> y[i];
  }
  long xsum = 0,ysum = 0;
  for(long i = 1;i <= n;i++){
    xsum += (i-1)*x[i]%inf - (n-i)*x[i]%inf;
    xsum %= inf;
  }
  for(long i = 1;i <= m;i++){
    ysum += (i-1)*y[i]%inf - (m-i)*y[i]%inf;
    ysum %= inf;
  }
  if(xsum < 0){
    xsum += inf;
  }
  if(ysum < 0){
    ysum += inf;
  }
  cout << (xsum)*(ysum)%inf << endl;
}