#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> X, Y;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    X.push_back(x);
  }
  for (long long i = 0; i < m; i++) {
    long long y;
    cin >> y;
    Y.push_back(y);
  }
  vector<long long> A, B;
  for (long long i = 1; i < n; i++) A.push_back(i * (n - i));
  for (long long i = 1; i < m; i++) B.push_back(i * (m - i));
  vector<long long> X_breadth, Y_breadth;
  for (long long i = 1; i < n; i++) X_breadth.push_back(X[i] - X[i - 1]);
  for (long long i = 1; i < m; i++) Y_breadth.push_back(Y[i] - Y[i - 1]);
  long long line = 0;
  for (long long i = 0; i < X_breadth.size(); i++) {
    line += A[i] * X_breadth[i];
    line %= mod;
  }
  long long ans = 0;
  for (long long i = 0; i < Y_breadth.size(); i++) {
    ans += line * Y_breadth[i] * B[i];
    ans %= mod;
  }
  cout << ans << endl;
}
