#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pl = pair<ll, ll>;
using vpl = vector<pl>;
using vvpl = vector<vpl>;
const ll MOD = 1000000007;
const ll MOD9 = 998244353;
const int inf = 1e9 + 10;
const ll INF = 4e18;
const ll dy[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const ll dx[8] = {0, -1, 0, 1, 1, -1, 1, -1};
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
double comb(ll n, ll k) {
  double res = 1;
  for (ll i = 0; i < k; i++) {
    res *= n - i;
    res /= i + 1;
    res /= 4;
  }
  return res;
}
int main() {
  ll n, m;
  cin >> n >> m;
  vl x(n), y(m);
  for (ll i = 0; i < n; i++) cin >> x[i];
  for (ll i = 0; i < m; i++) cin >> y[i];
  sort((x).begin(), (x).end());
  sort((y).begin(), (y).end());
  ll cumx = 0;
  for (ll i = 0; i < n - 1; i++) {
    ll l = i, r = i + 1;
    ll res = (l + 1) * (n - r);
    res %= MOD;
    res *= x[r] - x[l];
    res %= MOD;
    cumx += res;
  }
  ll cumy = 0;
  for (ll i = 0; i < m - 1; i++) {
    ll l = i, r = i + 1;
    ll res = (l + 1) * (m - r);
    res %= MOD;
    res *= y[r] - y[l];
    res %= MOD;
    cumy += res;
  }
  cout << (cumx * cumy) % MOD << endl;
}
