#include <bits/stdc++.h>
int main(void) {
  int n, m;
  long long int x[100010];
  long long int y[100010];
  int i, j, k, l;
  int flag = 0;
  long int ans = 0;
  int count = 0;
  long long int temp, temp1, temp2;
  int max, min;
  int len;
  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]);
  }
  temp1 = 0;
  temp2 = 0;
  for (i = 0; i < n - 1; i++) {
    temp = (n - i - 1) * (i + 1) % 1000000007;
    temp = temp * (x[i + 1] - x[i]) % 1000000007;
    temp1 = (temp1 + temp) % 1000000007;
  }
  for (i = 0; i < m - 1; i++) {
    temp = (m - i - 1) * (i + 1) % 1000000007;
    temp = temp * (y[i + 1] - y[i]) % 1000000007;
    temp2 = (temp2 + temp) % 1000000007;
  }
  printf("%lld", temp1 * temp2 % 1000000007);
  return 0;
}
