#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vin = vector<int>;
using vll = vector<ll>;
using vst = vector<string>;
using P = pair<int, int>;
const int inf = 1e9 + 7;
const ll INF = 9e18;
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline void Yes(T condition) {
  if (condition)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
template <class T>
inline void YES(T condition) {
  if (condition)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  cout << fixed << setprecision(20);
  ll n, m;
  cin >> n >> m;
  vll x(n), y(n);
  for (ll i = 0; i < (n); ++i) cin >> x[i];
  for (ll i = 0; i < (m); ++i) cin >> y[i];
  ll tate = 0, ans = 0;
  for (ll i = 0; i < (m - 1); ++i) {
    tate =
        (tate + (y[i + 1] - y[i]) % inf * (i + 1) % inf * (m - i - 1) % inf) %
        inf;
  }
  for (ll i = 0; i < (n - 1); ++i) {
    ans = (ans +
           tate * (x[i + 1] - x[i]) % inf * (i + 1) % inf * (n - i - 1) % inf) %
          inf;
  }
  cout << ans << endl;
}
