#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  long long *x = new long long[n], *y = new long long[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 sum1{};
  for (int i = 0; i < n - 1; i++) {
    sum1 = (sum1 + (i + 1) * (n - i - 1) * (x[i + 1] - x[i])) % 1000000007;
  }
  long long sum2{};
  for (int i = 0; i < m - 1; i++) {
    sum2 = (sum2 + (i + 1) * (m - i - 1) * (y[i + 1] - y[i])) % 1000000007;
  }
  printf("%lld\n", sum1 * sum2 % 1000000007);
  delete[] x;
  delete[] y;
  return 0;
}
