#include <bits/stdc++.h>
int main() {
  int n, m, i, j, count;
  scanf("%d %d", &n, &m);
  long x[n];
  long y[m];
  for (i = 0; i < n; i++) {
    scanf("%ld", &x[i]);
  }
  for (i = 0; i < m; i++) {
    scanf("%ld", &y[i]);
  }
  count = 0;
  int x_num = n * (n - 1) / 2;
  int y_num = m * (m - 1) / 2;
  long x_sides[x_num];
  long y_sides[y_num];
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      x_sides[count] = labs(x[i] - x[j]);
      count++;
    }
  }
  count = 0;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      y_sides[count] = labs(y[i] - y[j]);
      count++;
    }
  }
  long s = 0;
  for (i = 0; i < x_num; i++) {
    for (j = 0; j < y_num; j++) {
      s += x_sides[i] * y_sides[j];
    }
  }
  printf("%ld\n", (s % 1000000007));
  return 0;
}
