#include <bits/stdc++.h>
using namespace std;
const long long INF = 100000000000;
const long long MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> x, y;
  for (int i = 0; i < n; i++) {
    long long xx;
    cin >> xx;
    x.push_back(xx);
  }
  for (int i = 0; i < m; i++) {
    long long yy;
    cin >> yy;
    y.push_back(yy);
  }
  long long xsum = 0, ysum = 0;
  for (int i = 1; i < n; i++) {
    xsum += (x[i] - x[i - 1]) * i * (n - i) % MOD;
  }
  for (int i = 1; i < m; i++) {
    ysum += (y[i] - y[i - 1]) * i * (m - i) % MOD;
  }
  cout << xsum * ysum % MOD << endl;
  return 0;
}
