#include <bits/stdc++.h>
using namespace std;
signed 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];
  }
  sort((x).begin(), (x).end());
  sort((y).begin(), (y).end());
  reverse((x).begin(), (x).end());
  reverse((y).begin(), (y).end());
  long long X = 0, Y = 0;
  for (long long i = 0; i < n; i++) {
    X += x[i] * (n - 2 * i - 1);
    X %= 1000000007;
  }
  for (long long i = 0; i < m; i++) {
    Y += y[i] * (m - 2 * i - 1);
    Y %= 1000000007;
  }
  cout << X * Y << endl;
}
