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

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

typedef long long int ll;

const ll INF=(ll)1e18;

int main(){
  int n,m;
  cin >> n >> m;
  vector<ll> x(n),y(m);

  REP(i,n)cin>>x[i]; 
  REP(i,m)cin>>y[i];

  ll xx=0;
  REP(i,n){
    xx += ((2*i-n+1)*x[i] % MOD);
    xx %= MOD;
  }
  ll yy=0;
  REP(i,m){
    yy += ((2*i-m+1)*y[i] % MOD);
    yy %= MOD;
  }
  cout << (xx*yy)%MOD << endl;


}

