#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> X(N), Y(M);
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  sort(X.begin(), X.end());
  vector<long long> dX;
  for (int i = N - 1; i >= 1; i--) {
    for (int j = i - 1; j >= 0; j--) {
      dX.push_back(X[i] - X[j]);
    }
  }
  for (int i = 0; i < M; i++) {
    cin >> Y[i];
  }
  sort(Y.begin(), Y.end());
  vector<long long> dY;
  for (int i = M - 1; i >= 1; i--) {
    for (int j = i - 1; j >= 0; j--) {
      dY.push_back(Y[i] - Y[j]);
    }
  }
  long long ans = 0;
  for (int i = 0; i < dX.size(); i++) {
    for (int j = 0; j < dY.size(); j++) {
      ans += dX[i] * dY[j];
      ans = ans % (1000000007);
    }
  }
  cout << ans << endl;
  return 0;
}
