#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll linf = 1e18;
const double eps = 1e-12, pi = acos(-1);
template <typename Head>
void out(Head h) {
  cout << h << endl;
}
template <typename Head, typename... Tail>
void out(Head h, Tail... t) {
  cout << h << " ";
  out(t...);
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto&& x : v) is >> x;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<string>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << v[i];
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << v[i];
  }
  return os;
}
struct yes_no : std::numpunct<char> {
  string_type do_truename() const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};
void solve();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  locale loc(locale(), new yes_no);
  cout.imbue(loc);
  cout << fixed << setprecision(10) << boolalpha;
  solve();
}
constexpr ll mod = 1e9 + 7;
constexpr ll mul(ll a, ll b) { return a * b % mod; }
ll mul(initializer_list<ll> t) {
  ll res = 1;
  for (auto&& v : t) res = mul(res, v);
  return res;
}
ll add(ll a, ll b) { return (a + b) % mod; }
ll add(initializer_list<ll> t) {
  ll res = 0;
  for (auto&& v : t) res = add(res, v);
  return res;
}
ll sub(ll a, ll b) { return (a - b + mod) % mod; }
ll sub(initializer_list<ll> t) {
  auto it = t.begin();
  ll res = *(it++);
  while (it != t.end()) res = sub(res, *(it++));
  return res;
}
ll inv(ll n);
ll power(ll x, ll n) {
  if (n < 0) return inv(power(x, -n));
  ll res = 1;
  for (ll i = 1; i <= n; i <<= 1) {
    if (i & n) res = mul(res, x);
    x = mul(x, x);
  }
  return res;
}
ll inv(ll n) { return power(n, mod - 2); }
ll divi(ll a, ll b) { return mul(a, inv(b)); }
ll divi(initializer_list<ll> t) {
  auto it = t.begin();
  ll res = *(it++);
  while (it != t.end()) res = divi(res, *(it++));
  return res;
}
using Row = vector<ll>;
using Matrix = vector<Row>;
Matrix E(ll n) {
  Matrix res(n, Row(n, 0));
  for (ll i = (0), __last_i = (n); i < __last_i; i++) res[i][i] = 1;
  return res;
}
Matrix mul(const Matrix& A, const Matrix& B) {
  const ll n = A.size(), m = A[0].size(), l = B[0].size();
  assert(m == B.size());
  Matrix res(n, Row(l, 0));
  for (ll i = (0), __last_i = (n); i < __last_i; i++)
    for (ll j = (0), __last_j = (m); j < __last_j; j++)
      for (ll k = (0), __last_k = (l); k < __last_k; k++)
        res[i][k] = add(res[i][k], mul(A[i][j], B[j][k]));
  return res;
}
Row mul(const Matrix& A, const Row& x) {
  Matrix tx(x.size());
  for (ll i = (0), __last_i = (x.size()); i < __last_i; i++)
    tx[i] = Row(1, x[i]);
  tx = mul(A, tx);
  Row res(x.size());
  for (ll i = (0), __last_i = (x.size()); i < __last_i; i++) res[i] = tx[i][0];
  return res;
}
Matrix power(Matrix A, ll n) {
  assert(A.size() == A[0].size());
  Matrix res = E(A.size());
  for (ll i = 1; i <= n; i <<= 1) {
    if (i & n) res = mul(res, A);
    A = mul(A, A);
  }
  return res;
}
vector<ll> make_coe(ll n) {
  vector<ll> res(n);
  for (ll i = (0), __last_i = (n); i < __last_i; i++) {
    res[i] = mul(i + 1, n - i);
  }
  return res;
}
void solve() {
  ll n, m;
  cin >> n >> m;
  vector<ll> x(n), y(m);
  cin >> x >> y;
  vector<ll> dx(n - 1), dy(m - 1);
  for (ll i = (0), __last_i = (n - 1); i < __last_i; i++) {
    dx[i] = x[i + 1] - x[i];
    dy[i] = y[i + 1] - y[i];
  }
  vector<ll> cx = make_coe(n - 1);
  vector<ll> cy = make_coe(m - 1);
  for (ll i = (0), __last_i = (n - 1); i < __last_i; i++)
    dx[i] = mul(dx[i], cx[i]);
  for (ll i = (0), __last_i = (m - 1); i < __last_i; i++)
    dy[i] = mul(dy[i], cy[i]);
  ll ysum = 0, xsum = 0;
  for (auto&& v : dy) ysum = add(ysum, v);
  for (auto&& v : dx) xsum = add(xsum, v);
  ll ans = mul(xsum, ysum);
  cout << ans << endl;
}
