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