#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m, t = 0, t2 = 0, tx, ty;
  long long r, a = 0;
  cin >> n >> m;
  vector<int> x;
  vector<int> y;
  vector<long long> rx;
  vector<long long> f(n, 1);
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (i != 0) x.push_back(t - t2);
    t2 = t;
  }
  for (int i = 0; i < m; i++) {
    cin >> t;
    if (i != 0) y.push_back(t - t2);
    t2 = t;
  }
  tx = accumulate(x.begin(), x.end(), 0) % 1000000007;
  ty = accumulate(y.begin(), y.end(), 0) % 1000000007;
  for (int i = 1; i < n; i++) {
    f[i] = (i * f[i - 1]) % 1000000007;
  }
  for (int i = 0; i < x.size(); i++) {
    rx.push_back(((n - 2 + f[n - 2] / (f[i] * f[n - i - 2])) * x[i]) %
                 1000000007);
  }
  tx = accumulate(rx.begin(), rx.end(), 0) % 1000000007;
  for (int i = 0; i < y.size(); i++) {
    r = m - 2 + f[m - 2] / (f[i] * f[m - i - 2]);
    a = (a + tx * y[i] * r) % 1000000007;
  }
  cout << a;
}
