#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> x(n), y(m);
  for (int i = 0; i < n; i++) {
    cin >> x.at(i);
  }
  for (int i = 0; i < m; i++) {
    cin >> y.at(i);
  }
  ll X = x.at(n - 1) - x.at(0);
  ll Y = y.at(m - 1) - y.at(0);
  ll ans = 0;
  for (ll i = 0; i < n - 1; i++) {
    ans += ((x.at(i + 1) - x.at(i)) * Y % 1000000007) *
           ((i + 1) % 1000000007 * (n - i - 1) % 1000000007) % 1000000007;
    ans %= 1000000007;
  }
  for (ll i = 0; i < m - 1; i++) {
    ans += ((y.at(i + 1) - y.at(i)) * X % 1000000007) *
           ((i + 1) * (m - i - 1) % 1000000007) % 1000000007;
    ans %= 1000000007;
  }
  cout << ans << endl;
}
