#include <bits/stdc++.h>
using namespace std;
int main() {
  const int iMod = 1000000007;
  int i;
  int j;
  int N;
  int M;
  long long iVal;
  long long iH;
  long long iW;
  cin >> N;
  cin >> M;
  vector<int> X(N);
  vector<int> Y(M);
  for (i = 0; i < N; i++) cin >> X[i];
  for (i = 0; i < M; i++) cin >> Y[i];
  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;
    iW %= iMod;
  }
  iH = 0;
  for (i = 1; i < M; i++) {
    iVal = Y[i] - Y[i - 1];
    iVal %= iMod;
    iVal *= i;
    iVal %= iMod;
    iVal *= N - i;
    iVal %= iMod;
    iH += iVal;
    iH %= iMod;
  }
  cout << (iW * iH) % iMod << endl;
  return 0;
}
