#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  vector<long long> 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];
  vector<long long> x(n), y(m);
  for (int i = 1; i < ((int)n); i++) x[i] = X[i] - X[i - 1];
  for (int i = 1; i < ((int)m); i++) y[i] = Y[i] - Y[i - 1];
  vector<long long> dpxcum(n), dpycum(m);
  vector<long long> dpx(n), dpy(m);
  for (int i = 1; i < ((int)n); i++) {
    dpx[i] = (dpx[i - 1] + i * x[i] * 1 + dpxcum[i - 1]) % MOD;
    dpxcum[i] = (dpxcum[i - 1] + i * x[i] * 1) % MOD;
  }
  for (int i = 1; i < ((int)m); i++) {
    dpy[i] = (dpy[i - 1] + i * y[i] * dpx[n - 1] + dpycum[i - 1]) % MOD;
    dpycum[i] = (dpycum[i - 1] + i * y[i] * dpx[n - 1]) % MOD;
  }
  cout << dpy[m - 1] << endl;
}
