#include <bits/stdc++.h>
long int SUM(long int a, long int b) {
  return (a % 1000000007 + b % 1000000007 + 1000000007) % 1000000007;
}
long int PROD(long int a, long int b) {
  return a % 1000000007 * (b % 1000000007) % 1000000007;
}
int main() {
  long int n, m, x[100000], y[100000], i, j, sx = 0, sy = 0;
  scanf("%ld%ld", &n, &m);
  for (i = 0; i < n; i++) scanf("%ld", &x[i]);
  for (i = 0; i < m; i++) scanf("%ld", &y[i]);
  for (i = 0; i < n; i++)
    for (j = i + 1; j < n; j++) sx = SUM(sx, x[j] - x[i]);
  for (i = 0; i < m; i++)
    for (j = i + 1; j < m; j++) sy = SUM(sy, y[j] - y[i]);
  printf("%ld", PROD(sx, sy));
}
