#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(const T& x) {
  cout << x << endl;
}
template <class T, class... A>
void print(const T& first, const A&... rest) {
  cout << first << " ";
  print(rest...);
}
struct PreMain {
  PreMain() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} premain;
const int mod = 1e9 + 7;
struct mint {
  long long x;
  mint(long long a = 0) { x = a >= 0 ? a % mod : mod - (-a) % mod; }
  mint(const mint& m) : x(m.x) {}
  mint& operator+=(const mint& a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator+=(const int& a) {
    if ((x += a) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint& a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const int& a) {
    if ((x += mod - a) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint& a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint& operator*=(const int& a) {
    (x *= a) %= mod;
    return *this;
  }
  mint operator+(const mint& a) const {
    mint res(*this);
    return res += a;
  }
  mint operator+(const int& a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint& a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator-(const int& a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator-() const {
    mint res(*this);
    return mint(0) - res;
  }
  mint operator*(const mint& a) const {
    mint res(*this);
    return res *= a;
  }
  mint operator*(const int& a) const {
    mint res(*this);
    return res *= a;
  }
  bool operator==(const mint& a) const { return x == a.x; }
  bool operator==(const int& a) const { return x == a; }
  bool operator!=(const mint& a) const { return x != a.x; }
  bool operator!=(const int& a) const { return x != a; }
  operator bool() const { return x > 0; }
  mint pow(long long t) const {
    mint r = 1, a = *this;
    do {
      if (t & 1) r *= a;
      a *= a;
    } while (t >>= 1);
    return r;
  }
  mint pow(mint t) const {
    mint r = 1, a = *this;
    do {
      if (t.x & 1) r *= a;
      a *= a;
    } while (t.x >>= 1);
    return r;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint& a) { return (*this) *= a.inv(); }
  mint& operator/=(const int& a) { return (*this) *= mint(a).inv(); }
  mint operator/(const mint& a) const {
    mint res(*this);
    return res /= a;
  }
  mint operator/(const int& a) const {
    mint res(*this);
    return res /= a;
  }
  friend ostream& operator<<(ostream& os, const mint& m) {
    cout << m.x;
    return os;
  }
  friend istream& operator>>(istream& is, mint& m) { return is >> m.x; }
};
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> X(N), Y(M);
  for (int(i) = 0; (i) < (int)(N); ++(i)) cin >> X[i];
  for (int(i) = 0; (i) < (int)(M); ++(i)) cin >> Y[i];
  int n = N - 1, m = M - 1;
  vector<mint> A(n), B(m);
  for (int(i) = 0; (i) < (int)(n); ++(i)) A[i] = X[i + 1] - X[i];
  for (int(i) = 0; (i) < (int)(m); ++(i)) B[i] = Y[i + 1] - Y[i];
  auto f = [](long long n, long long k) {
    if (k > (n + 1) / 2) k = n - k + 1;
    mint ret = 0;
    ret += (1 + k) * k;
    ret += k * (n - 2 * k);
    return ret;
  };
  vector<mint> coef1(n);
  for (int(i) = 0; (i) < (int)(n); ++(i)) coef1[i] = f(n, i + 1);
  vector<mint> coef2(m);
  for (int(i) = 0; (i) < (int)(m); ++(i)) coef2[i] = f(m, i + 1);
  mint tmp1 = 0;
  for (int(i) = 0; (i) < (int)(n); ++(i)) tmp1 += coef1[i] * A[i];
  mint tmp2 = 0;
  for (int(i) = 0; (i) < (int)(m); ++(i)) tmp2 += coef2[i] * B[i];
  mint ans = tmp1 * tmp2;
  print(ans);
  return 0;
}
