#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long min(long long a, long long b) { return (a < b) ? a : b; }
long long INFL = 1000000000000000010;
int INF = 1000000000;
long long MOD = 1000000007;
long long N, M;
vector<long long> x(100010);
vector<long long> y(100010);
int main() {
  cin >> N >> M;
  for (long long i = 0; i < N; i++) cin >> x[i];
  for (long long i = 0; i < M; i++) cin >> y[i];
  vector<long long> X(N - 1), Y(M - 1);
  for (long long i = 0; i < N - 1; i++) X[i] = x[i + 1] - x[i];
  for (long long i = 0; i < M - 1; i++) Y[i] = y[i + 1] - y[i];
  for (long long i = 0; i < N - 1; i++) {
    X[i] %= MOD;
    X[i] *= (i + 1) * (N - i - 1);
    X[i] %= MOD;
  }
  for (long long i = 0; i < M - 1; i++) Y[i] %= MOD;
  long long W = 0;
  for (long long i = 0; i < N - 1; i++) {
    W += X[i];
    W %= MOD;
  }
  long long ans = 0;
  for (long long i = 0; i < M - 1; i++) {
    ans += Y[i] * W * (i + 1) * (M - 1 - i);
    ans %= MOD;
  }
  cout << ans << endl;
}
