#include <bits/stdc++.h>
using namespace std;
template <typename T, size_t N>
constexpr size_t NELEMS(T (&)[N]) {
  return N;
}
using ll = long long;
int N, M;
ll NW, NH;
ll W[100000 - 1];
ll H[100000 - 1];
ll MOD = 1000000007;
void solve() {
  ll sum_a = 0;
  ll sum_b = 0;
  ll cnt[100000 - 1];
  cnt[0] = NW;
  for (int i = (1); i < (NW / 2 + 1); ++i) {
    cnt[i] = cnt[i - 1] + NW - 2 * i;
  }
  if (NW % 2 == 1) {
    cnt[NW / 2 + 1] = cnt[NW / 2] + NW - 2 * (NW / 2 + 1);
  }
  for (int i = (0); i < (NW / 2); ++i) {
    cnt[NW - 1 - i] = cnt[i];
  }
  for (int i = (0); i < (NW); ++i) {
    sum_a += (cnt[i] * W[i]) % MOD;
    sum_a %= MOD;
  }
  cnt[0] = NH;
  for (int i = (1); i < (NH / 2); ++i) {
    cnt[i] = cnt[i - 1] + NH - 2 * i;
  }
  if (NH % 2 == 1) {
    cnt[NH / 2 + 1] = cnt[NH / 2] + NH - 2 * (NH / 2 + 1);
  }
  for (int i = (0); i < (NH / 2); ++i) {
    cnt[NH - 1 - i] = cnt[i];
  }
  for (int i = (0); i < (NH); ++i) {
    sum_b += (cnt[i] * H[i]) % MOD;
    sum_b %= MOD;
  }
  ll ans = (sum_a * sum_b) % MOD;
  cout << ans << "\n";
}
int main() {
  cin >> N >> M;
  NW = N - 1;
  NH = M - 1;
  ll x_prev, y_prev;
  cin >> x_prev;
  for (int i = (0); i < (NW); ++i) {
    ll x;
    cin >> x;
    W[i] = x - x_prev;
    x_prev = x;
  }
  cin >> y_prev;
  for (int i = (0); i < (NH); ++i) {
    ll y;
    cin >> y;
    H[i] = y - y_prev;
    y_prev = y;
  }
  solve();
  return 0;
}
