#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const ll MOD = 1000000007;

int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> x(n), y(m);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> y[i];
  }
  ll x2 = 0, y2 = 0;
  for (ll i = 0; i < n - 1; ++i) {
    ll tmp = ((i + 1) * (n - 1 - i)) * (x[i + 1] - x[i]);
    x2 += tmp;
    x2 %= MOD;
  }
  for (ll i = 0; i < m - 1; ++i) {
    ll tmp = ((i + 1) * (m - 1 - i)) * (y[i + 1] - y[i]);
    y2 += tmp;
    y2 %= MOD;
  }
  cout << (x2 * y2) % MOD << endl;
  return 0;
}
