#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long int> x(n), y(m), dx, dy, gx, gy;
  for (int i = int(0); i < int(n); i++) {
    cin >> x[i];
  }
  for (int i = int(0); i < int(m); i++) {
    cin >> y[i];
  }
  sort(begin(x), end(x));
  sort(begin(y), end(y));
  for (int i = int(0); i < int(n - 1); i++) {
    dx.push_back(x[i + 1] - x[i]);
  }
  for (int i = int(0); i < int(m - 1); i++) {
    dy.push_back(y[i + 1] - y[i]);
  }
  long long int ddx = 1LL * (n - 1);
  long long int ddy = 1ll * (m - 1);
  gx.push_back(ddx);
  ddx -= 2LL;
  gy.push_back(ddy);
  ddy -= 2LL;
  while (ddx > 0) {
    gx.push_back((gx[gx.size() - 1] + ddx) % 1000000007);
    ddx -= 2LL;
  }
  while (ddy > 0) {
    gy.push_back((gy[gy.size() - 1] + ddy) % 1000000007);
    ddy -= 2LL;
  }
  if ((n - 1) % 2 == 0) {
    int si = gx.size();
    for (int i = si - 1; i >= 0; i--) {
      gx.push_back(gx[i]);
    }
  } else {
    int si = gx.size();
    for (int i = si - 2; i >= 0; i--) {
      gx.push_back(gx[i]);
    }
  }
  if ((m - 1) % 2 == 0) {
    int si = gy.size();
    for (int i = si - 1; i >= 0; i--) {
      gy.push_back(gy[i]);
    }
  } else {
    int si = gy.size();
    for (int i = si - 2; i >= 0; i--) {
      gy.push_back(gy[i]);
    }
  }
  long long int ax = 0LL, ay = 0LL;
  for (int i = int(0); i < int(gx.size()); i++) {
    ax += 1LL * (gx[i] * dx[i]) % 1000000007;
  }
  for (int i = int(0); i < int(gy.size()); i++) {
    ay += 1LL * (gy[i] * dy[i]) % 1000000007;
  }
  long long int ans = (ax * ay) % 1000000007;
  cout << ans << endl;
  return 0;
}
