#include <bits/stdc++.h>
long long div_mod(long long x, long long y, long long z) {
  if (x % y == 0)
    return x / y;
  else
    return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}
int main() {
  int i, n, m;
  long long x[100001], y[100001];
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%lld", &(x[i]));
  for (i = 1; i <= m; i++) scanf("%lld", &(y[i]));
  long long ans = 0, tmp = 0;
  for (i = 1; i < n; i++)
    tmp = (tmp + (x[i + 1] - x[i]) * (i * (n - i) % 1000000007)) % 1000000007;
  for (i = 1; i < m; i++)
    ans = (ans + (tmp * (y[i + 1] - y[i]) % 1000000007) *
                     (i * (m - i) % 1000000007)) %
          1000000007;
  printf("%lld\n", ans);
  fflush(stdout);
  return 0;
}
