#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int INF = 1e7;
int main() {
  int n, m;
  cin >> n >> m;
  long long x[n], y[m];
  long long cx[100001], cy[100001];
  memset(cx, 0, sizeof(cx));
  memset(cy, 0, sizeof(cy));
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  sort(x, x + n);
  sort(y, y + m);
  for (int i = 1; i <= 100000; i++) {
    cx[i] = i + i * (n - i - 1) % mod;
    cy[i] = i + i * (m - i - 1) % mod;
  }
  long long sx = 0, sy = 0;
  for (int i = 0; i < n - 1; i++) {
    sx += (x[i + 1] - x[i]) * cx[i + 1] % mod;
    sx %= mod;
  }
  for (int i = 0; i < m - 1; i++) {
    sy += (y[i + 1] - y[i]) * cy[i + 1] % mod;
    sy %= mod;
  }
  cout << sx * sy % mod << endl;
  return 0;
}
