#include <bits/stdc++.h>
using namespace std;
static const double PI = 3.1415926535897932384626433;
long long x[100001] = {};
long long y[100001] = {};
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> x[i];
  for (long long i = 1; i <= m; i++) cin >> y[i];
  sort(x + 1, x + n);
  sort(y + 1, y + n);
  long long MOD = 1000000007;
  long long X = 0;
  for (long long k = 1; k <= n; k++) {
    X = (long long)((X + (2 * k - n + 1) * x[k] % MOD) % MOD);
  }
  long long Y = 0;
  for (long long k = 1; k <= m; k++) {
    Y = (long long)((Y + (2 * k - m + 1) * y[k] % MOD) % MOD);
  }
  cout << X * Y % MOD << endl;
  return 0;
}
