#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using pll = pair<ll, ll>;
template <typename T>
using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T>
using que = queue<T>;
template <typename T>
using deq = deque<T>;
template <typename T>
T id(T b) {
  return b;
};
template <typename T>
void chmax(T &x, T y) {
  if (x < y) x = y;
}
template <typename T>
void chmin(T &x, T y) {
  if (x > y) x = y;
}
template <typename S, typename K>
bool contains(S &s, K k) {
  return s.find(k) != s.end();
}
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
constexpr ll TEN(int n) {
  if (n == 0)
    return 1LL;
  else
    return 10LL * TEN(n - 1);
}
const ll MOD = TEN(9) + 7;
const ll MAX_N = 100000;
ll n, m;
ll x[MAX_N];
ll y[MAX_N];
int main() {
  fastio();
  cin >> n >> m;
  for (size_t i = 0; i < size_t(n); i++) cin >> x[i];
  for (size_t i = 0; i < size_t(m); i++) cin >> y[i];
  ll a = 0, b = 0;
  for (size_t i = 0; i < size_t(n - 1); i++) {
    a += 1LL * (i + 1) % MOD * (n - i - 1) % MOD * (x[i + 1] - x[i]) % MOD;
  }
  for (size_t i = 0; i < size_t(m - 1); i++) {
    b += 1LL * (i + 1) % MOD * (m - i - 1) % MOD * (y[i + 1] - y[i]) % MOD;
  }
  cout << a * b % MOD << endl;
  return 0;
}
