#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int64_t sum = 0, xsum = 0, ysum = 0;
  cin >> n >> m;
  int x[100000], y[100000];
  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 = 0; i < n - 1; i++) {
    xsum += (int64_t)(x[i + 1] - x[i]) * (i + 1) * (n - i - 1) % 1000000007;
  }
  for (int j = 0; j < m - 1; j++) {
    ysum += (int64_t)(y[j + 1] - y[j]) * (j + 1) * (m - j - 1) % 1000000007;
  }
  cout << (xsum * ysum) % 1000000007;
}
