#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long mod = pow(10, 9) + 7;
  long long N, M;
  cin >> N >> M;
  vector<long long> X(N), Y(M);
  for (long long i = 0; i < N; ++i) {
    cin >> X.at(i);
  }
  for (long long i = 0; i < M; ++i) {
    cin >> Y.at(i);
  }
  long long sum_x = 0, sum_y = 0;
  for (long long i = 0; i < N - 1; ++i) {
    sum_x = (sum_x + ((((X.at(i + 1) - X.at(i)) % mod) * (i + 1)) % mod) *
                         (N - i - 1) % mod);
  }
  for (long long i = 0; i < M - 1; ++i) {
    sum_y = (sum_y + ((((Y.at(i + 1) - Y.at(i)) % mod) * (i + 1)) % mod) *
                         (M - i - 1) % mod);
  }
  long long ans = sum_x * sum_y % mod;
  cout << ans << "\n";
}
