#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = acos(-1);
using namespace std;
struct INIT {
  INIT() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  }
} INIT;
signed main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> x(N);
  for (ll i = 0; i < ll(N); ++i) cin >> x[i];
  vector<ll> y(M);
  for (ll i = 0; i < ll(M); ++i) cin >> y[i];
  vector<ll> dn(N - 1);
  for (ll i = 0; i < ll(N - 1); ++i) dn[i] = (i + 1) * (N - 1 - i);
  vector<ll> dm(M - 1);
  for (ll i = 0; i < ll(M - 1); ++i) dm[i] = (i + 1) * (M - 1 - i);
  ll p = 0;
  for (ll i = 0; i < ll(M - 1); ++i) {
    (p += dm[i] * (y[i + 1] - y[i]) % MOD) %= MOD;
  }
  ll ans = 0;
  for (ll i = 0; i < ll(N - 1); ++i) {
    (ans += p * (x[i + 1] - x[i]) * dn[i]) %= MOD;
  }
  cout << ans << "\n";
  return 0;
}
