#include <bits/stdc++.h>
int main() {
  long int m, n, i, j, k, l;
  long long int *x, *y;
  unsigned long long int area = 0, width, height;
  scanf("%ld %ld", &n, &m);
  x = (long long int *)malloc(sizeof(x) * n);
  y = (long long int *)malloc(sizeof(y) * 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 - 1; i++) {
    for (j = i + 1; j < n; j++) {
      width = x[j] - x[i];
      for (k = 0; k < m - 1; k++) {
        for (l = k + 1; l < m; l++) {
          height = y[l] - y[k];
          area += width * height;
          if (area > 1000000007) area = area % 1000000007;
        }
      }
    }
  }
  printf("%lld\n", area);
  return 0;
}
