#include <bits/stdc++.h>
using namespace std;
const int INF = 10000000;
const long long INFL = (1LL << 50);
const double PI = atan(1) * 4;
const int MOD = pow(10, 9) + 7;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  }
  return os;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> x(n);
  vector<ll> y(m);
  cin >> x >> y;
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  ll x_direc = 0;
  ll y_direc = 0;
  for (int i = 0; i < n; i++) {
    x_direc += (i)*x[i] - (n - 1 - i) * x[i];
  }
  for (int i = 0; i < n; i++) {
    y_direc += (i)*y[i] - (m - 1 - i) * y[i];
  }
  x_direc %= MOD;
  y_direc %= MOD;
  ll out = x_direc * y_direc;
  out %= MOD;
  cout << out << endl;
  return 0;
}
