#include <bits/stdc++.h>
using namespace std;
vector<long long> calc_times(long long n) {
  vector<long long> ret(n);
  int prodiff = n;
  ret[0] = n;
  ret[n - 1] = n;
  for (int i = 1; 2 * i < n; i++) {
    prodiff -= 2;
    ret[i] = ret[i - 1] + prodiff;
    ret[n - 1 - i] = ret[i - 1] + prodiff;
  }
  return ret;
}
void solve(long long n, long long m, vector<long long> X, vector<long long> Y) {
  vector<long long> times_of_x(n - 1);
  vector<long long> times_of_y(m - 1);
  long long modll = 1000000007;
  times_of_x = calc_times(n - 1);
  times_of_y = calc_times(m - 1);
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  long long answer = 0;
  long long sum_X = 0;
  long long sum_Y = 0;
  for (int i = 0; i < n - 1; i++) {
    sum_X += (X[i + 1] - X[i]) * times_of_x[i] % modll;
  }
  for (int i = 0; i < m - 1; i++) {
    sum_Y += (Y[i + 1] - Y[i]) * times_of_y[i] % modll;
  }
  answer = sum_X * sum_Y % modll;
  cout << answer << endl;
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> X(n);
  vector<long long> Y(m);
  for (long long i = 0; i < n; i++) {
    cin >> X[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> Y[i];
  }
  solve(n, m, X, Y);
  return 0;
}
