#include <bits/stdc++.h>
using namespace std;
long long pow(long long x, long long e) {
  if (e == 0) return 1;
  if (e == 1) return x;
  return pow(x * x % 1000000007, e / 2) * pow(x, e % 2) % 1000000007;
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long fact[100001], ifact[100001];
  fact[0] = ifact[0] = 1;
  for (int i = 1; i <= 100000; i++) fact[i] = i * fact[i - 1] % 1000000007;
  for (int i = 1; i <= 100000; i++) ifact[i] = pow(fact[i], 1000000007 - 2);
  long long *x, *y;
  x = new long long[n];
  y = new long long[m];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long ax = 0, ay = 0;
  for (long long i = 1; i < n; i++) {
    ax += (((fact[n - 2] * ifact[i - 1] % 1000000007) * ifact[n - i - 1] %
            1000000007) +
           (n - 2)) *
          (x[i] - x[i - 1]) % 1000000007;
    ax %= 1000000007;
  }
  for (long long i = 1; i < m; i++) {
    ay += (((fact[m - 2] * ifact[i - 1] % 1000000007) * ifact[m - i - 1] %
            1000000007) +
           (m - 2)) *
          (y[i] - y[i - 1]) % 1000000007;
    ay %= 1000000007;
  }
  cout << (ax * ay % 1000000007) << endl;
  delete[] x, y;
  return 0;
}
