#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll Mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  ll x[n];
  ll y[m];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  ll dx[n - 1];
  ll dy[m - 1];
  for (int i = 1; i < n; i++) {
    dx[i - 1] = x[i] - x[i - 1];
  }
  for (int i = 1; i < m; i++) {
    dy[i - 1] = y[i] - y[i - 1];
  }
  ll ans = 0;
  ll tmp = 0;
  for (ll i = 0; i < n - 1; i++) {
    ll res = (i + 1) * (n - i - 1);
    res %= Mod;
    res *= dx[i];
    res %= Mod;
    tmp += res;
    tmp %= Mod;
  }
  for (int i = 0; i < m - 1; i++) {
    ll res = (i + 1) * (m - i - 1);
    res %= Mod;
    res *= tmp;
    res %= Mod;
    res *= dy[i];
    res %= Mod;
    ans += res;
    ans %= Mod;
  }
  cout << ans << endl;
  return 0;
}
