#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll HMOD = (ll)1e9 + 7;
const ll LMOD = 998244353;
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;
const long double EPS = 1e-10;
void YN(bool flag) { cout << ((flag) ? "YES" : "NO") << endl; }
void Yn(bool flag) { cout << ((flag) ? "Yes" : "No") << endl; }
void yn(bool flag) { cout << ((flag) ? "yes" : "no") << endl; }
int main() {
  int N, M;
  cin >> N >> M;
  vector<ll> x(N), y(M), p(N, 0), q(M, 0);
  for (int i = 0; i < int(N); i++) cin >> x[i];
  for (int i = 0; i < int(M); i++) cin >> y[i];
  sort((x).begin(), (x).end());
  sort((y).begin(), (y).end());
  p[0] = x[0];
  q[0] = y[0];
  for (int i = int(1); i < int(N); i++)
    (p[i] += (p[i - 1] % HMOD + x[i] % HMOD) % HMOD) %= HMOD;
  for (int i = int(1); i < int(M); i++)
    (q[i] += (q[i - 1] % HMOD + y[i] % HMOD) % HMOD) %= HMOD;
  ll s = 0, r = 0;
  for (int i = 0; i < int(N); i++)
    (s += (((i + 1) % HMOD) * (x[i] % HMOD)) % HMOD) %= HMOD;
  for (int i = 0; i < int(N); i++) (s -= (p[i] % HMOD)) %= HMOD;
  for (int i = 0; i < int(M); i++)
    (r += (((i + 1) % HMOD) * (y[i] % HMOD)) % HMOD) %= HMOD;
  for (int i = 0; i < int(M); i++) (r -= (q[i] % HMOD)) %= HMOD;
  cout << ((s % HMOD) * (r % HMOD)) % HMOD << endl;
  return 0;
}
