#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const ll MOD = 1e9 + 7;
int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> x(n);
  vector<ll> y(m);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> y[i];
  }
  ll h = 0;
  ll w = 0;
  for (ll k = 1; k <= n; k++) {
    h += (2 * k - n - 1) * x[k - 1];
  }
  for (ll k = 1; k <= m; k++) {
    w += (2 * k - n - 1) * y[k - 1];
  }
  h %= MOD;
  w %= MOD;
  cout << (h * w) % MOD << endl;
  return 0;
}
