#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int n_max = 1e5 + 10;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n);
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  vector<long long> y(m);
  for (int i = 0; i < (int)(m); i++) cin >> y[i];
  long long res = 1;
  long long x_t = 0, y_t = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    long long len = (x[i + 1] - x[i]) % MOD;
    long long num = (i + 1) * (n - (i + 1)) % MOD;
    x_t += (len * num) % MOD;
  }
  for (int i = 0; i < (int)(m - 1); i++) {
    long long len = (y[i + 1] - y[i]) % MOD;
    long long num = (i + 1) * (m - (i + 1)) % MOD;
    y_t += (len * num) % MOD;
  }
  res = (x_t * y_t) % MOD;
  cout << res << endl;
}
