#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using ti = tuple<int, int, int>;
using tl = tuple<ll, ll, ll>;
template <typename T>
using vec = vector<T>;
template <typename T>
using mat = vector<vec<T>>;
template <typename T>
using cub = vector<mat<T>>;
template <typename T>
using val = valarray<T>;
template <typename T>
using pq = priority_queue<T>;
template <typename T>
using rpq = priority_queue<T, vec<T>, greater<T>>;
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "P(" << p.first << ", " << p.second << ") ";
  return os;
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  cout << "V{";
  for (int i = 0; i < (int)v.size(); ++i) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  cout << "}";
  return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &in : v) is >> in;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const valarray<T> &v) {
  cout << "V{";
  for (int i = 0; i < (int)v.size(); ++i) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  cout << "}";
  return os;
}
template <typename T>
istream &operator>>(istream &is, valarray<T> &v) {
  for (T &in : v) is >> in;
  return is;
}
template <int mod>
struct ModInt {
  int x;
  ModInt() : x(0) {}
  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  ModInt &operator+=(const ModInt &p) {
    if ((x += p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &p) {
    if ((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &p) {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }
  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }
  ModInt operator-() const { return ModInt(-x); }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt &p) const { return x == p.x; }
  bool operator!=(const ModInt &p) const { return x != p.x; }
  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while (b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while (n > 0) {
      if (n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }
  static int get_mod() { return mod; }
};
constexpr int MOD = 1e9 + 7;
using mint = ModInt<MOD>;
locale LOCATE = locale::classic();
int main(void) {
  int n, m;
  cin >> n >> m;
  vec<int> x(n), y(m);
  cin >> x >> y;
  ll X = n * (n - 1) / 2;
  ll Y = m * (m - 1) / 2;
  auto f = [](int p) { return p * (p - 1) / 2; };
  mint H = 0, W = 0;
  for (int(i) = 0; (i) < (int)(n - 1); ++(i)) {
    H += (x[i + 1] - x[i]) * (X - f(i + 1) - f(n - i - 1));
  }
  for (int(i) = 0; (i) < (int)(m - 1); ++(i)) {
    W += (y[i + 1] - y[i]) * (Y - f(i + 1) - f(m - i - 1));
  }
  mint ans = H * W;
  cout << ans << endl;
}
