#include <bits/stdc++.h>
int main(void) {
  long long int n, m;
  scanf("%lld %lld", &n, &m);
  long long int i, j, xtotal = 0, ytotal = 0;
  long long int x[n], y[m];
  for (i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
    xtotal += (i)*x[i] - (n - i - 1) * x[i];
  }
  for (i = 0; i < m; i++) {
    scanf("%lld", &y[i]);
    ytotal += (i)*y[i] - (m - i - 1) * y[i];
  }
  xtotal = xtotal * ytotal;
  printf("%lld\n", xtotal % (1000000000 + 7));
}
