#include<bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)

using namespace std;

const int MOD = 1e9+7;

int main(){
  long long n,m,sx=0,sy=0,a,b;

  scanf("%lld%lld",&n,&m);
  vector<int> x(n);
  vector<int> y(m);
  a = n - 1;
  b = m - 1;
  REP(i,n) scanf("%d",&x[i]);
  REP(i,m) scanf("%d",&y[i]);

  REP(i,n){
    sx += (2*i-a)*x[i];
    sx %= MOD;
  }
  REP(i,m){
    sy += (2*i-b)*y[i];
    sy %= MOD;
  }

  a = sx * sy;
  printf("%lld\n",a%MOD);
  return 0;
}
