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