#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
ll mod = 1000000007;
ll sa(long long a, long long b) {
  if (a > b) return a - b;
  return b - a;
}
int main() {
  ll n, m;
  cin >> n >> m;
  vll x(n), y(m);
  for (auto &i : x) cin >> i;
  for (auto &i : y) cin >> i;
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  vll xsum(n, 0), xsub(n, 0);
  for (int i = 1; i < n; i++) xsub.at(i) = sa(x.at(i), x.at(i - 1)) * i % mod;
  for (int i = 1; i < n; i++) xsum.at(i) = (xsum.at(i - 1) + xsub.at(i)) % mod;
  for (int i = 1; i < n; i++) (xsum.at(i) += xsum.at(i - 1)) %= mod;
  vll ysum(n, 0), ysub(n, 0);
  for (int i = 1; i < m; i++) ysub.at(i) = sa(y.at(i), y.at(i - 1)) * i % mod;
  for (int i = 1; i < m; i++) ysum.at(i) = (ysum.at(i - 1) + ysub.at(i)) % mod;
  for (int i = 1; i < m; i++) (ysum.at(i) += ysum.at(i - 1)) %= mod;
  cout << xsum.at(n - 1) * ysum.at(m - 1) % mod << endl;
}
