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

int main(){
  int n, m;
  cin >> n >> m;
  ll x[n], y[m];
  rep(i,n) cin >> x[i];
  rep(i,m) cin >> y[i];
  sort(x,x+n,greater<ll>());
  sort(y,y+m,greater<ll>());
  ll sx = 0, sy = 0;
  rep(i,n) (sx += x[i]*(n-1-2*i)) %= mod;
  rep(i,m) (sy += y[i]*(m-1-2*i)) %= mod;
  cout << sx*sy % mod << endl;
  return 0;
}
