#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long mod2 = 998244353;
const long long INF = 1e18;
const long double EPS = 1e-10;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (int i = 0; i < (n); ++i) cin >> x[i];
  for (int i = 0; i < (m); ++i) cin >> y[i];
  vector<long long> cx(n - 1, n - 1), cy(m - 1, m - 1);
  long long resx = 0, resy = 0;
  for (int i = 0; i < (n - 1); ++i) {
    cx[i] += i * (n - 2 - i);
    cx[i] = (cx[i] * (x[i + 1] - x[i])) % mod;
    resx = (resx + cx[i]) % mod;
  }
  for (int i = 0; i < (m - 1); ++i) {
    cy[i] += i * (m - 2 - i);
    cy[i] = (cy[i] * (y[i + 1] - y[i])) % mod;
    resy = (resy + cy[i]) % mod;
  }
  long long ans = (resx * resy) % mod;
  cout << ans << endl;
  return 0;
}
