#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  const int iMod = 1000000007;
  int i;
  int j;
  int N;
  int M;
  int *X;
  int *Y;
  int *XX;
  long long iVal;
  long long iSum;
  long long iH;
  long long iW;
  cin >> N;
  cin >> M;
  X = new int[N + 5];
  XX = new int[N + 5];
  Y = new int[M + 5];
  for (i = 0; i < N; i++) {
    cin >> X[i];
  }
  for (i = 0; i < M; i++) {
    cin >> Y[i];
  }
  iSum = 0;
  iW = 0;
  for (i = 1; i < N; i++) {
    iVal = X[i] - X[i - 1];
    iVal %= iMod;
    iVal *= i;
    iVal %= iMod;
    iVal *= N - i;
    iVal %= iMod;
    iW += iVal;
  }
  for (j = 1; j < M; j++) {
    iH = Y[j] - Y[j - 1];
    iH %= iMod;
    iVal = iW * iH;
    iVal %= iMod;
    iVal *= j;
    iVal %= iMod;
    iVal *= M - j;
    iVal %= iMod;
    iSum += iVal;
    iSum %= iMod;
  }
  cout << iSum << endl;
  return 0;
}
