#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  vector<long long int> x, y;
  cin >> n >> m;
  x = vector<long long int>(n);
  y = vector<long long int>(m);
  for (auto i = 0; i < x.size(); ++i) {
    cin >> x[i];
  }
  for (auto i = 0; i < y.size(); ++i) {
    cin >> y[i];
  }
  if (n < m) {
    swap(x, y);
  }
  long long int sumX{0};
  long long int sumY{0};
  long long int xi;
  auto fx = [&xi](long long int sum, long long int num) {
    return sum + abs(num - xi);
  };
  for (auto i = 0; i < x.size() - 1; ++i) {
    xi = x[i];
    sumX = accumulate(x.begin() + i + 1, x.end(), sumX, fx);
    if (i + 1 < y.size()) {
      xi = y[i];
      sumY = accumulate(y.begin() + i + 1, y.end(), sumY, fx);
    }
  }
  sumX = (sumX % ((long long int)powl(10ll, 9ll) + 7ll));
  sumY = (sumY % ((long long int)powl(10ll, 9ll) + 7ll));
  long long int sum = sumX * sumY;
  cout << (sum % ((long long int)powl(10ll, 9ll) + 7ll)) << endl;
  return 0;
}
