#include <bits/stdc++.h>
using namespace std;
int dy[4] = {-1, 1, 0, 0};
int dx[4] = {0, 0, 1, -1};
int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  vector<long long> x(n);
  vector<long long> y(m);
  for (long long i = 0; i < (long long)(n); i++) cin >> x[i];
  for (long long i = 0; i < (long long)(m); i++) cin >> y[i];
  sort((x).begin(), (x).end());
  sort((y).begin(), (y).end());
  long long sumX = 0;
  long long sumY = 0;
  for (long long i = 0; i < (long long)(n); i++) {
    long long tmp =
        -(i * x[i] % 1000000007LL) + ((n - (i + 1)) * x[i] % 1000000007LL);
    while (tmp < 0) {
      tmp += 1000000007LL;
    }
    sumX += tmp % 1000000007LL;
  }
  for (long long i = 0; i < (long long)(m); i++) {
    long long tmp =
        -(i * y[i] % 1000000007LL) + ((m - (i + 1)) * y[i] % 1000000007LL);
    while (tmp < 0) {
      tmp += 1000000007LL;
    }
    sumY += tmp;
  }
  cout << sumX * sumY % 1000000007LL << endl;
  return 0;
}
