#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp, vector<Q_temp>, greater<Q_temp> >;
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const ll MOD = (ll)(1e9 + 7);
const double PI = acos(-1.0);
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};
inline ll CEIL(ll a, ll b) { return (a + b - 1) / b; }
void finish() {
  cout << -1 << endl;
  exit(0);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  ll x[100010], y[100010];
  for (ll i = 0; i < (ll)(n); ++i) cin >> x[i];
  for (ll i = 0; i < (ll)(m); ++i) cin >> y[i];
  ll x_sum = 0, y_sum = 0;
  for (ll i = 0; i < (ll)(n - 1); ++i) {
    x_sum += (x[i + 1] - x[i]) * (i + 1) % MOD * (n - (i + 1)) % MOD;
    x_sum %= MOD;
  }
  for (ll i = 0; i < (ll)(m - 1); ++i) {
    y_sum += (y[i + 1] - y[i]) * (i + 1) % MOD * (m - (i + 1)) % MOD;
    y_sum %= MOD;
  }
  cout << x_sum * y_sum % MOD << endl;
  return 0;
}
