#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, k[112345], l[112345], ans;
  cin >> a >> b;
  for (int i = 0; i < a; ++i) {
    cin >> k[i];
  }
  for (int i = 0; i < b; ++i) {
    cin >> l[i];
  }
  sort(k, k + a);
  sort(l, l + b);
  long long int aa = k[a - 1] - k[0];
  if (aa < 0) aa *= -1;
  long long int bb = l[b - 1] - l[0];
  if (bb < 0) bb *= -1;
  if (a % 2 == b % 2) {
    ans = (a - 1) * (b - 1) * aa * bb;
  } else if (a % 2 == 0 && b % 2 == 1) {
    long long int o = (k[a / 2 + 1] - k[a / 2]) * (l[b - 1] - l[0]);
    if (o < 0) o *= -1;
    ans = (a - 1) * (b - 1) * aa * bb + o;
  } else {
    long long int o = (k[a - 1] - k[0]) * (l[b / 2 + 1] - l[b / 2]);
    if (o < 0) o *= -1;
    ans = (a - 1) * (b - 1) * aa * bb + o;
  }
  if (ans < 0) ans *= -1;
  cout << ans % 1000000007 << endl;
}
