#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

const int MOD = 1e9 + 7;
using P = pair<int,int>;

signed main(){

  int n,m; cin >> n >> m;
  vector<int> x(n),y(m);
  for(int i = 0; i < n; i++) cin >> x[i];
  for(int i = 0; i < m; i++) cin >> y[i];
  sort(x.begin(),x.end());
  sort(y.begin(),y.end());

  int k = 0,l = 0;
  for(int i = 0; i < n; i++){
    k += (x[i] * (i - (n-1-i)));
    k %= MOD;
  }
  for(int i = 0; i < m; i++){
    l += (y[i] * (i - (m-1-i)));
    l %= MOD;
  }
  cout << (k * l) % MOD << endl;

  return 0;
}
