#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
random_device rnd;
mt19937 mt(rnd());
const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  VL 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());
  ll sx = 0;
  for (int i = (0); i < (n); ++i) {
    sx += MOD * n + i * x[i];
    sx %= MOD;
    sx -= (MOD * n + (n - 1 - i) * x[i]) % MOD;
    while (sx < 0) sx += MOD;
  }
  ll sy = 0;
  for (int i = (0); i < (m); ++i) {
    sy += MOD * m + i * y[i];
    sy %= MOD;
    sy -= (MOD * m + (m - 1 - i) * y[i]) % MOD;
    while (sy < 0) sy += MOD;
  }
  cout << (sx * sy) % MOD << endl;
  ;
  return 0;
}
