#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];
  }
  long long int sumX{0};
  for (auto i = 0; i < x.size() - 1; ++i) {
    for (auto j = i + 1; j < x.size(); ++j) {
      sumX += abs(x[j] - x[i]);
    }
  }
  long long int sumY{0};
  for (auto i = 0; i < y.size() - 1; ++i) {
    for (auto j = i + 1; j < y.size(); ++j) {
      sumY += abs(y[j] - y[i]);
    }
  }
  long long int sum = sumX * sumY;
  cout << (sum % ((long long int)powl(10ll, 9ll) + 7ll)) << endl;
  return 0;
}
