#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e5 + 5;
const int pt = 1e9 + 7;
int n, m;
long long sum_x, ans;
long long x[MaxN], y[MaxN];
int main() {
  while (~scanf("%d %d", &n, &m)) {
    for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);
    for (int i = 1; i <= m; i++) scanf("%lld", &y[i]);
    sort(x + 1, x + 1 + n);
    sort(y + 1, y + 1 + m);
    long long yy = (y[m] - y[1]) % pt;
    long long xx = (x[n] - x[1]) % pt;
    ans = 0;
    for (int i = 2; i <= n; i++) {
      long long l = (x[i] - x[i - 1]) % pt;
      long long num = l * yy % pt;
      num = num * (n - 1) % pt;
      ans = (ans + num) % pt;
    }
    for (int i = 2; i <= m; i++) {
      long long l = (y[i] - y[i - 1]) % pt;
      long long num = l * xx % pt;
      num = num * (m - 1) % pt;
      ans = (ans + num) % pt;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
