#include <bits/stdc++.h>
using namespace std;
class modint {
 public:
  using long long = long long;
  long long num;
  static const long long MOD = 1e9 + 7;
  static vector<modint> factorial;
  modint() : num(0){};
  modint(long long _n) : num((_n + MOD) % MOD) {}
  modint(const modint &r) : num(r.num) {}
  operator long long() const { return (num + MOD) % MOD; }
  friend istream &operator>>(istream &is, modint &r) {
    long long num_;
    is >> num_;
    r = num_;
    return is;
  }
  modint operator+(const modint &r) const { return modint(num + r.num); }
  modint operator-(const modint &r) const { return modint(num - r.num); }
  modint operator*(const modint &r) const { return modint(num * r.num); }
  template <typename T>
  modint operator^(const T &r) const {
    if (r == 0) return 1;
    return (((*this) * (*this)) ^ (r / 2)) * modint(r & 1 ? num : 1);
  }
  modint operator/(const modint &r) const { return num * (r ^ (MOD - 2)); }
  modint operator+=(const modint &r) { return *this = *this + r; }
  modint operator-=(const modint &r) { return *this = *this - r; }
  modint operator*=(const modint &r) { return *this = *this * r; }
  modint operator/=(const modint &r) { return *this = *this / r; }
  template <typename T>
  modint operator^=(const T &r) {
    return *this = *this ^ r;
  }
  static modint fact(int n) {
    if ((int)factorial.size() <= n) factorial.resize(n + 1);
    if (factorial[n]) return factorial[n];
    if (n == 0) return 1;
    return factorial[n] = modint(n) * fact(n - 1);
  }
  static modint com(long long n, long long r) {
    return n >= r ? fact(n) / (fact(n - r) * fact(r)) : modint(0);
  }
};
vector<modint> modint::factorial;
modint solve(vector<long long> &v, int n) {
  modint sum = 0;
  for (int i = 0; i < int(n - 1); ++i)
    sum += modint(v[i + 1] - v[i]) * modint((i + 1) * (n - i - 1));
  return sum;
}
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<long long> 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];
  cout << solve(x, n) * solve(y, m) << endl;
  return 0;
}
