#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void init();
void solve();
signed main() {
  init();
  solve();
}
struct LAN {
  vector<int> p;
};
struct PERSON {
  vector<int> l;
};
int N, M;
vector<ll> x, y;
vector<ll> xc, yc;
void init() {
  cin >> N >> M;
  x.resize(N - 1);
  y.resize(M - 1);
  vector<ll> tx, ty;
  do {
    tx.resize(N);
    for (int i = 0; (i) < (int)(N); (i)++) cin >> tx[i];
  } while (0);
  ;
  do {
    ty.resize(M);
    for (int i = 0; (i) < (int)(M); (i)++) cin >> ty[i];
  } while (0);
  ;
  xc.resize(N - 1);
  yc.resize(M - 1);
  for (int i = 0; (i) < (int)(N - 1); (i)++) {
    x[i] = tx[i + 1] - tx[i];
  }
  for (int i = 0; (i) < (int)(M - 1); (i)++) {
    y[i] = ty[i + 1] - ty[i];
  }
  for (int i = 0; (i) < (int)(N - 1); (i)++) {
    xc[i] = (i + 1) * (N - i - 1);
  }
  for (int i = 0; (i) < (int)(M - 1); (i)++) {
    yc[i] = (i + 1) * (M - i - 1);
  }
}
void solve() {
  ll H = 0;
  for (int i = 0; (i) < (int)(M - 1); (i)++) {
    H += y[i] * yc[i];
    H %= 1000000007;
  }
  ll ans = 0;
  for (int i = 0; (i) < (int)(N - 1); (i)++) {
    ans += x[i] * xc[i] % 1000000007 * H % 1000000007;
    ans %= 1000000007;
  }
  cout << ans << endl;
}
