#include<bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(n); i++)
#define ll long long
using namespace std;

const int MOD=1000000007;

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 X=0,Y=0;
  rep(i, n) {
    X+=x[i]*(2*i+1-n);
    X%=MOD;
  }
  rep(i, m) {
    Y+=y[i]*(2*i+1-m);
    Y%=MOD;
  }
  ll res=X*Y;
  res%=MOD;
  cout<<res<<endl;
}