#include <bits/stdc++.h>
using namespace std;
int main() {
  int mod = 1000000007;
  int n, m;
  cin >> n >> m;
  vector<long long> x(n), a(n - 1), y(m), b(m - 1);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> x.at(i);
  }
  for (int i = 0; i < (int)(n - 1); ++i) {
    a[i] = x[i + 1] - x[i];
  }
  for (int i = 0; i < (int)(m); ++i) {
    cin >> y.at(i);
  }
  for (int i = 0; i < (int)(m - 1); ++i) {
    b[i] = y[i + 1] - y[i];
  }
  long long ans = (n - 1) * a[0];
  if (n >= 3) {
    ans += (n - 1) * a[n - 2];
  }
  for (int i = (1); i < (int)(n - 2); i++) {
    long long now = n / 2 * (n / 2 + 1 - (n - 1) % 2) % mod * a[i] % mod;
    ans = (ans + now) % mod;
  }
  long long co = (m - 1) * b[0];
  if (m >= 3) {
    co += (m - 1) * b[m - 2];
  }
  for (int i = (1); i < (int)(m - 2); i++) {
    long long now = m / 2 * (m / 2 + 1 - (m - 1) % 2) % mod * b[i] % mod;
    co = (co + now) % mod;
  }
  ans = ans * co % mod;
  cout << ans << endl;
}
