#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
std::random_device rd;
std::mt19937 mt(rd());
constexpr long long MOD = 1e9 + 7;
constexpr long long MAX = 200020;
const double pi = acos(-1);
constexpr double EPS = 1e-8;
constexpr long long INF = 1e16;
void solve() {
  long long N, M;
  cin >> N >> M;
  vector<long long> X(N), Y(M);
  for (long long i = 0; i < N; ++i) cin >> X[i];
  for (long long i = 0; i < M; ++i) cin >> Y[i];
  sort(X.begin(), X.end());
  ;
  sort(Y.begin(), Y.end());
  ;
  long long h = 0, w = 0;
  for (long long i = 0; i < N; ++i) {
    h += X[i] * i % MOD;
    h -= X[i] * (N - i - 1) % MOD;
    if (h < 0) h += MOD;
  }
  for (long long j = 0; j < M; ++j) {
    w += Y[j] * j % MOD;
    w -= Y[j] * (M - j - 1) % MOD;
    if (w < 0) w += MOD;
  }
  cout << (h * w % MOD) << '\n';
}
signed main() { solve(); }
