#include <bits/stdc++.h>
const int MOD = 1000000007;
long long add(long long a, long long b) {
  return ((a % MOD) + (b % MOD)) % MOD;
}
long long sub(long long a, long long b) {
  return ((a % MOD) - (b % MOD)) % MOD;
}
long long mult(long long a, long long b) {
  return ((a % MOD) * (b % MOD)) % MOD;
}
int main() {
  int n, m;
  long long x[100000], y[100000];
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%lld", x + i);
  for (int i = 0; i < m; i++) scanf("%lld", y + i);
  long long dxs = 0, dys = 0;
  for (int i = 0; i < n; i++)
    dxs = add(dxs, sub(mult(i, x[i]), mult(n - i - 1, x[i])));
  for (int i = 0; i < m; i++)
    dys = add(dys, sub(mult(i, y[i]), mult(m - i - 1, y[i])));
  printf("%lld\n", mult(dxs, dys));
  return 0;
}
