#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline long long toLL(string s) {
  long long v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<long long> x(n);
  vector<long long> y(m);
  for (long long i = 0; i < (long long)(n); i++) cin >> x[i];
  for (long long i = 0; i < (long long)(m); i++) cin >> y[i];
  sort((x).begin(), (x).end());
  long long xsum = 0;
  for (long long i = 0; i < (long long)(n); i++) {
    xsum += i * x[i];
    if (xsum < 0) xsum += mod;
    xsum %= mod;
    xsum -= (n - 1 - i) * x[i];
    if (xsum < 0) xsum += mod;
    xsum %= mod;
  }
  sort((y).begin(), (y).end());
  long long ans = 0;
  for (long long i = 0; i < (long long)(m); i++) {
    ans += xsum * i * y[i];
    if (ans < 0) ans += mod;
    ans %= mod;
    ans -= xsum * (m - 1 - i) * y[i];
    if (ans < 0) ans += mod;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
