#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  long long int X[114514] = {};
  long long int Y[114514] = {};
  long long int P[114514] = {};
  long long int Q[114514] = {};
  long long int H[114514] = {};
  long long int W[114514] = {};
  long long int H1, W1;
  for (int i = 0; i < N; ++i) {
    cin >> X[i];
  }
  for (int j = 0; j < M; ++j) {
    cin >> Y[j];
  }
  for (int i = 1; i < N; ++i) {
    P[i] = X[i] - X[i - 1];
    H[i] = (i * (N - i) * P[i]) % 1000000007;
  }
  for (int j = 1; j < M; ++j) {
    Q[j] = Y[j] - Y[j - 1];
    W[j] = (j * (M - j) * Q[j]) % 1000000007;
  }
  for (int i = 1; i < N; ++i) {
    H1 = (H1 + H[i]) % 1000000007;
  }
  for (int j = 1; j < M; ++j) {
    W1 = (W1 + W[j]) % 1000000007;
  }
  cout << (H1 * W1) % 1000000007 << endl;
}
