#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = decltype(1ull);
template <class T>
int size(T&& a) {
  return a.size();
}
template <class B>
pair<int, B> make_pair(B b) {
  return {0, b};
}
void Calc();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin.exceptions(istream::failbit | istream::badbit);
  cout << fixed << setprecision(15);
  Calc();
  cout.flush();
  return 0;
}
template <class A>
void amax(A& a, A b) {
  a = max(a, b);
}
template <class A>
void amin(A& a, A b) {
  a = min(a, b);
}
template <class A>
int comp(A a, A b) {
  return a < b ? 1 : b < a ? -1 : 0;
}
struct Scanner {
  template <class A = string>
  A Next() {
    A a;
    cin >> a;
    return a;
  }
  template <class A = int>
  vector<A> Array(int n) {
    vector<A> a(n);
    for (A& i : a) cin >> i;
    return a;
  }
  string Line() const {
    string s;
    getline(cin, s);
    return s;
  }
  template <class A>
  Scanner& operator,(A& a) {
    a = Next<A>();
    return *this;
  }
  template <class A>
  operator A() {
    return Next<A>();
  }
} in;
template <class... T>
tuple<T...> Init(T... t) {
  return tuple<T...>{t...};
}
template <class T>
tuple<T> Init(T t) {
  return tuple<T>{t};
}
template <int N, int... I>
struct idx_seq : idx_seq<N - 1, 0, (I + 1)...> {};
template <int... I>
struct idx_seq<0, I...> {};
template <class R, class T, int... I>
R InitInternal(T&& a, idx_seq<0, I...>) {
  return R{get<I>(a)...};
}
template <class T, class B, class... V>
struct Vec {
  vector<typename Vec<T, V...>::t> nvec(B a, V... b) {
    return vector<typename Vec<T, V...>::t>(a, Vec<T, V...>().nvec(b...));
  }
};
template <class T, class B>
struct Vec<T, B> {
  using X = typename conditional<is_same<T, nullptr_t>::value, int, T>::type;
  vector<X> nvec(B a) { return vector<X>(a); }
};
template <class T, class... C>
struct Vec<T, tuple<C...>> {
  template <class Vec<T, V...>, class B>
  static pair<Vec<T, V...>, B> X(Vec<T, V...>, B);
  template <class... Vec<T, V...>>
  static tuple<Vec<T, V...>...> X(Vec<T, V...>...);
  using vector<X> = typename conditional<is_same<T, nullptr_t>::value,
                                         decltype(X(C{}...)), T>::type;
  vector<X> nvec(tuple<C...> a) {
    return InitInternal<vector<X>>(a, idx_seq<sizeof...(C)>());
  }
};
template <class T, class C>
struct Vec<T, tuple<C>> {
  using X = typename conditional<is_same<T, nullptr_t>::value, C, T>::type;
  using vector<X> = X;
  vector<X> nvec(tuple<C> a) { return {get<0>(a)}; }
};
template <class T = nullptr_t, class... B>
typename Vec<T, B...>::vector<X> nvec(B... b) {
  return Vec<T, B...>().nvec(b...);
}
const ll mod = (ll)1e9 + 7;
template <ll MOD>
struct Mint {
  typedef const Mint& T;
  ll x = 0;
  Mint() {}
  Mint(ll a) {
    x = a % MOD;
    if (x < 0) x += MOD;
  }
  Mint& operator+=(T a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  Mint& operator-=(T a) {
    if ((x += MOD - a.x) >= MOD) x -= MOD;
    return *this;
  }
  Mint& operator*=(T a) {
    x = x * a.x % MOD;
    return *this;
  }
  Mint& operator/=(T a) { return *this *= a.Pow(MOD - 2); }
  Mint operator+(T a) const { return Mint(*this) += a; }
  Mint operator-(T a) const { return Mint(*this) -= a; }
  Mint operator*(T a) const { return Mint(*this) *= a; }
  Mint operator/(T a) const { return Mint(*this) /= a; }
  bool operator<(T a) const { return x < a.x; }
  bool operator==(T a) const { return x == a.x; }
  Mint Pow(ll k) const {
    if (k == 0) return 1;
    Mint vector<X> = Pow(k / 2);
    return vector<X> *= (k & 1) ? vector<X> * *this : vector<X>;
  }
};
template <ll MOD>
istream& operator>>(istream& i, Mint<MOD>& a) {
  return i >> a.x;
}
template <ll MOD>
ostream& operator<<(ostream& o, const Mint<MOD>& a) {
  return o << a.x;
}
template <ll MOD = mod>
Mint<MOD> CombMod(int n, int r) {
  Mint<MOD> a = 1, b = 1;
  for (typename make_signed<decltype(make_pair(r).second)>::type
           i = make_pair(r).first,
           _li = make_pair(r).second;
       i < _li; i++) {
    a *= (n - i);
  }
  for (typename make_signed<decltype(make_pair(2, r + 1).second)>::type
           i = make_pair(2, r + 1).first,
           _li = make_pair(2, r + 1).second;
       i < _li; i++) {
    b *= i;
  }
  (void)0;
  return a / b;
}
void Calc() {
  int n, m;
  in, n, m;
  ;
  auto x = in.Array(n);
  auto y = in.Array(m);
  auto u = nvec(n - 1);
  auto v = nvec(m - 1);
  for (typename make_signed<decltype(make_pair(n - 1).second)>::type
           i = make_pair(n - 1).first,
           _li = make_pair(n - 1).second;
       i < _li; i++) {
    u[i] = (i + 1) * (n - 1 - i);
  }
  (void)0;
  for (typename make_signed<decltype(make_pair(m - 1).second)>::type
           i = make_pair(m - 1).first,
           _li = make_pair(m - 1).second;
       i < _li; i++) {
    v[i] = (i + 1) * (m - 1 - i);
  }
  (void)0;
  Mint<mod> ans = 0;
  Mint<mod> xx = 0;
  for (typename make_signed<decltype(make_pair(n - 1).second)>::type
           i = make_pair(n - 1).first,
           _li = make_pair(n - 1).second;
       i < _li; i++) {
    xx += Mint<mod>(u[i]) * abs(x[i + 1] - x[i]);
  }
  for (typename make_signed<decltype(make_pair(m - 1).second)>::type
           i = make_pair(m - 1).first,
           _li = make_pair(m - 1).second;
       i < _li; i++) {
    ans += Mint<mod>(v[i]) * abs(y[i + 1] - y[i]) * xx;
  }
  cout << (ans) << endl;
}
