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