#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
int x[N], y[N];
int dx[N], dy[N];
int n, m;
void add_mod(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
void sub_mod(long long &a, long long b) {
  a -= b;
  if (a < 0) a += MOD;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x[i]);
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &y[i]);
  }
  sort(x + 1, x + n + 1);
  sort(y + 1, y + m + 1);
  for (int i = 1; i < n; ++i) {
    dx[i] = x[i + 1] - x[i];
  }
  for (int i = 1; i < m; ++i) {
    dy[i] = y[i + 1] - y[i];
  }
  n--;
  m--;
  long long sx = 0, sy = 0;
  long long tmp = 0;
  for (int i = 1; i <= n; ++i) add_mod(tmp, dx[i]);
  for (int i = n; i >= 1; --i) {
    add_mod(sx, tmp);
    sub_mod(tmp, dx[i]);
  }
  tmp = sx;
  for (int i = 2; i <= n; ++i) {
    sub_mod(tmp, (long long)(n - i + 2) * dx[i - 1] % MOD);
    sx += tmp;
  }
  tmp = 0;
  for (int i = 1; i <= m; ++i) add_mod(tmp, dy[i]);
  for (int i = m; i >= 1; --i) {
    add_mod(sy, tmp);
    sub_mod(tmp, dy[i]);
  }
  tmp = sy;
  for (int i = 2; i <= m; ++i) {
    sub_mod(tmp, (long long)(m - i + 2) * dy[i - 1] % MOD);
    sy += tmp;
  }
  printf("%lld\n", sx * sy % MOD);
  return 0;
}
