#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> x(N);
  vector<long long> y(M);
  for (int i = 0; i < N; i++) cin >> x.at(i);
  for (int i = 0; i < M; i++) cin >> y.at(i);
  long long X = 0;
  long long Y = 0;
  for (int i = 0; i < N - 1; i++) {
    for (int j = i + 1; j < N; j++) X += abs(x.at(i) - x.at(j));
  }
  X = X % 1000000007;
  for (int i = 0; i < M - 1; i++) {
    for (int j = i + 1; j < M; j++) Y += abs(y.at(i) - y.at(j));
  }
  Y = Y % 1000000007;
  long long ans = X * Y % 1000000007;
  cout << ans << endl;
}
