#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  long long x[n];
  long long y[m];
  long long xmin = 1e9;
  long long xmax = -1e9;
  long long ymin = 1e9;
  long long ymax = -1e9;
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
    xmin = min(xmin, x[i]);
    xmax = max(xmax, x[i]);
  }
  for (long long i = 0; i < m; i++) {
    cin >> y[i];
    ymin = min(ymin, y[i]);
    ymax = max(ymax, y[i]);
  }
  long long res = 0;
  vector<long long> xv, yv;
  long long xsum = 0;
  long long ysum = 0;
  for (long long i = 1; i < n; i++) {
    long long dx = x[i] - x[i - 1];
    long long contrib = ((((i) * (n - i)) % mod) * dx) % mod;
    xv.push_back(contrib);
    xsum += contrib;
  }
  for (long long i = 1; i < m; i++) {
    long long dy = y[i] - y[i - 1];
    long long contrib = ((((i) * (m - i)) % mod) * dy) % mod;
    yv.push_back(contrib);
    ysum += contrib;
  }
  for (long long i : xv) {
    res += (i * ysum) % mod;
    res %= mod;
  }
  cout << res << '\n';
}
