#include <bits/stdc++.h>
using namespace std;
signed main(signed argc, char* argv[]) {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long i = 0; i < m; i++) cin >> y[i];
  long long x_sum = 0, y_sum = 0;
  for (long long i = 0; i < n - 1; i++) {
    x_sum = x_sum +
            (x[i + 1] - x[i]) * (n - i - 1) % 1000000007 * (i + 1) % 1000000007;
  }
  for (long long i = 0; i < m - 1; i++) {
    y_sum = y_sum +
            (y[i + 1] - y[i]) * (m - i - 1) % 1000000007 * (i + 1) % 1000000007;
  }
  cout << y_sum * x_sum % 1000000007 << endl;
}
