#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> A(N), B(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  long long sumA = 0, sumB = 0;
  for (int i = 1; i < N; i++) {
    sumA += ((A[i] - A[i - 1]) * i * (N - i)) % mod;
  }
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  for (int i = 1; i < M; i++) {
    sumB += ((B[i] - B[i - 1]) * i * (M - i)) % mod;
  }
  cout << sumA * sumB % mod << endl;
}
