#include <bits/stdc++.h>
int main() {
  int n, m;
  int sum = 0;
  int xarray[100001];
  int yarray[100001];
  int xsum = 0;
  int ysum = 0;
  scanf("%d %d", &n, &m);
  for (int a = 1; a <= n; a++) {
    scanf(" %d", &xarray[a]);
  }
  for (int b = 1; b <= m; b++) {
    scanf(" %d", &yarray[b]);
  }
  for (int k = 1; k <= n; k++) {
    xsum = xsum + (2 * k - n - 1) * xarray[k];
  }
  for (int l = 1; l <= m; l++) {
    ysum = ysum + (2 * l - m - 1) * yarray[l];
  }
  sum = xsum * ysum;
  sum = sum % (1000000000 + 7);
  printf("%d\n", sum);
  return 0;
}
