#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e+9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> x(n), y(m);
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < m; ++i) cin >> y[i];
  int t = m - 1, b = 0;
  long long areay = 0;
  while (m > 0) {
    areay += (long long)(m - 1) * (y[t] - y[b]) % MOD;
    areay %= MOD;
    m -= 2;
    --t, ++b;
  }
  vector<long long> sumAreaX(n, 0);
  for (int i = 1; i < n; ++i) {
    sumAreaX[i] = areay * (x[i] - x[i - 1]) % MOD;
    sumAreaX[i] += sumAreaX[i - 1] % MOD;
  }
  int l = 0, r = n - 1;
  long long ans = 0;
  while (n > 0) {
    ans += (long long)(n - 1) * (sumAreaX[r] - sumAreaX[l]) % MOD;
    ans %= MOD;
    n -= 2;
    ++l, --r;
  }
  cout << ans % MOD << endl;
  return 0;
}
