#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll Q = 1000000007;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> X(N, 0);
  vector<ll> Y(M, 0);
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  for (int i = 0; i < M; i++) {
    cin >> Y[i];
  }
  ll sumX = 0, sumY = 0;
  for (ll i = 0; i < N; i++) {
    sumX += X[N - 1 - i] * (N - 2 * i - 1) % Q;
  }
  for (ll i = 0; i < M; i++) {
    sumY += Y[M - 1 - i] * (M - 2 * i - 1) % Q;
  }
  ll ans = sumX * sumY % Q;
  cout << ans << endl;
}
