#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(int argc, char const *argv[]) {
  int n, m, i, j, k, l;
  scanf("%d %d", &n , &m);


  long long *x;
  long long *y;
  x = malloc(sizeof(long long int) * n);
  y = malloc(sizeof(long long int) * m);
  for (i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
  }
  for (i = 0; i < m; i++) {
    scanf("%lld", &y[i]);
  }

  long long int sum_x = 0;
  long long int sum_y = 0;
  long long int sum = 0;

  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (x[i] < x[j]) {
        //printf("%lld\n", (x[j] - x[i]));
        sum_x += llabs(x[j] - x[i]) % (long long int)(1e9 + 7);
      }
    }
  }
  for (k = 0; k < m; k++) {
    for (l = 0; l < m; l++) {
      if (y[k] < y[l]) {
        //printf("%lld\n", llabs(y[l] - y[k]));
        sum_y += llabs(y[l] - y[k]) % (long long int)(1e9 + 7);
      }
    }
  }
  //  for (i = 0; i < n; i++) {
  //    for (j = 0; j < n; j++) {
  //      for (k = 0; k < m; k++) {
  //        for (l = 0; l < m; l++) {
  //          if (x[i] >= 1 && x[i] <= 1000000000 && x[i] < x[j] && x[j] >= 1 && x[j] <= 1000000000) {
  //            if (y[k] >= 1 && y[k] <= 1000000000 && y[k] < y[l] && y[l] >= 1 && y[l] <= 1000000000) {
  //              printf("%lld\n", (x[j] - x[i]) * (y[l] - y[k]));
  //              sum += (x[j] - x[i]) * (y[l] - y[k]);
  //            }
  //          }
  //        }
  //      }
  //    }
  //  }
  // printf("%lld\n", (long long)(sum_x * sum_y) % 1000000007);
  printf("%lld\n", ((long long int)(sum_x) % (long long int)(1e9 + 7) * (long long int)(sum_y) % (long long int)(1e9 + 7)) % (long long int)(1e9 + 7));
  //printf("%lld\n", (long long int)sum % (long long int)(1e9 + 7));
  free(x);
  free(y);
  return 0;
}
