#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  long long int i, j, k, l, m, n, sum, flag, cc, M, X, H, W, N, Y, Z, K;
  cc = 0;
  flag = 0;
  cin >> N >> M;
  vector<long long int> x(N);
  vector<long long int> y(M);
  for (i = 0; i < N; i++) {
    cin >> x[i];
  }
  for (j = 0; j < M; j++) {
    cin >> y[j];
  }
  long long int sumx = 0;
  long long int sumy = 0;
  for (i = 0; i < N - 1; i++) {
    cc = sumx;
    sumx += (x[i + 1] - x[i]) * (i + 1);
    sumx %= MOD;
    sumx += cc;
    sumx %= MOD;
  }
  for (i = 0; i < M - 1; i++) {
    cc = sumy;
    sumy += (y[i + 1] - y[i]) * (i + 1);
    sumy %= MOD;
    sumy += cc;
    sumy %= MOD;
  }
  cout << (sumx * sumy + MOD) % MOD << endl;
  ;
  return 0;
}
