#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
int main() {
  ll 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 ret = 0;
  for (int i = 0; i < x.size() - 1; ++i) {
    for (int j = 0; j < y.size() - 1; ++j) {
      ll temp = (x[i + 1] - x[i]) * (y[j + 1] - y[j]);
      temp = temp * (i + 1) * (x.size() - 1 - i) % MOD;
      temp = temp * (j + 1) * (y.size() - 1 - j) % MOD;
      ret = (ret + temp) % MOD;
    }
  }
  cout << ret << "\n";
  return 0;
}
