#include <bits/stdc++.h>

#define SOSU 1000000007

using namespace std;

int main(){
  int n,m; cin >> n >> m;
  long long x,y,sumx=0,sumy=0;
  for(int i=0;i<n;++i) {
    cin >> x;
    sumx+=i*x;
    sumx-=(n-(i+1))*x;
  }
  for(int i=0;i<m;++i) {
    cin >> y;
    sumy+=i*y;
    sumy-=(m-(i+1))*y;
  }
  sumx%=SOSU; sumy%=SOSU;
  cout << (sumx*sumy)%SOSU << endl;
  
  return 0;
}
