#include <bits/stdc++.h>
int fSortFnc(const void *pzpVal1, const void *pzpVal2) {
  int *lipVal1 = (int *)pzpVal1;
  int *lipVal2 = (int *)pzpVal2;
  if (*lipVal1 > *lipVal2) {
    return (1);
  } else if (*lipVal1 < *lipVal2) {
    return (-1);
  }
  return 0;
}
int fDelSame(int *pipArray, int *pipACnt) {
  int i;
  int liTNo = 1;
  for (i = 1; i < *pipACnt; i++) {
    if (pipArray[i] != pipArray[i - 1]) {
      pipArray[liTNo] = pipArray[i];
      liTNo++;
    }
  }
  *pipACnt = liTNo;
  return 0;
}
int fMain(int piTNo) {
  int i, j;
  char lc1Buf[1024], lc1Out[1024];
  int li1Cnt[2];
  fgets(lc1Buf, sizeof(lc1Buf), stdin);
  sscanf(lc1Buf, "%d%d", &li1Cnt[0], &li1Cnt[1]);
  long long ll1Len[2];
  for (i = 0; i < 2; i++) {
    ll1Len[i] = 0;
    int li1Pos[100000];
    for (j = 0; j < li1Cnt[i]; j++) {
      fscanf(stdin, "%d", &li1Pos[j]);
    }
    qsort(li1Pos, li1Cnt[i], sizeof(int), fSortFnc);
    fDelSame(li1Pos, &li1Cnt[i]);
    for (j = 0; j < li1Cnt[i]; j++) {
      ll1Len[i] += (long long)li1Pos[j] * (long long)j % 1000000007;
      ll1Len[i] %= 1000000007;
      ll1Len[i] -=
          (long long)li1Pos[j] * (long long)(li1Cnt[i] - j - 1) % 1000000007;
      ll1Len[i] %= 1000000007;
    }
  }
  long long llArea = ll1Len[0] * ll1Len[1] % 1000000007;
  sprintf(lc1Out, "%lld\n", llArea);
  printf("%s", lc1Out);
  return 0;
}
int main() {
  fMain(0);
  return 0;
}
