#include <bits/stdc++.h>
using namespace std;
const int nmax = 1e9 + 7;
const long long INF = 1e18;
const double PI = 2 * asin(1);
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> X(N), Y(M);
  for (int i = 0; i < N; i++) cin >> X[i];
  for (int i = 0; i < M; i++) cin >> Y[i];
  vector<long long> W(N - 1), H(M - 1);
  for (int i = 0; i < N - 1; i++) {
    W[i] = X[i + 1] - X[i];
    W[i] %= nmax;
  }
  for (int i = 0; i < M - 1; i++) {
    H[i] = Y[i + 1] - Y[i];
    H[i] %= nmax;
  }
  long long x = 0, y = 0;
  for (int i = 0; i < N - 1; i++) {
    long long now = (i + 1) * (N - 1 - i) % nmax;
    x += W[i] * now % nmax;
    x %= nmax;
  }
  for (int i = 0; i < M - 1; i++) {
    long long now = (i + 1) * (M - 1 - i) % nmax;
    y += H[i] * now % nmax;
    y %= nmax;
  }
  cout << (x * y) % nmax << endl;
  return 0;
}
