#include <bits/stdc++.h>
int main(void) {
  int n, m;
  scanf("%d %d", &n, &m);
  int i;
  long long int x_p = 0;
  long long int x_m = 0;
  long long int y_p = 0;
  long long int y_m = 0;
  long long int x, y;
  for (i = 0; i < n; i++) {
    scanf("%lld", &x);
    x_p = (x_p + i * x) % (1000000000 + 7);
    x_m = (x_m + (n - 1 - i) * x) % (1000000000 + 7);
  }
  for (i = 0; i < m; i++) {
    scanf("%lld", &y);
    y_p = (y_p + i * y) % (1000000000 + 7);
    y_m = (y_m + (m - 1 - i) * y) % (1000000000 + 7);
  }
  printf("%lld\n", ((x_p - x_m) * (y_p - y_m)) % (1000000000 + 7));
  return 0;
}
