#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vvd = vector<vd>;
using vvvi = vector<vvi>;
using vvvll = vector<vvll>;
using vvvd = vector<vvd>;
const double pi = acos(-1);
const ll MOD = 1e9 + 7;
int main() {
  ll n, m;
  cin >> n >> m;
  ll x[n], y[m];
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  for (int i = 0; i < (int)(m); i++) cin >> y[i];
  ll sy = 0;
  for (int i = 1; i < m; i++) {
    sy += (y[i] - y[i - 1]) * i * (m - i);
    sy %= MOD;
  }
  ll ans = 0;
  for (int i = 1; i < n; i++) {
    ans += i * (n - i) * (x[i] - x[i - 1]) * sy;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
