#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;

ll calc(const vector<ll>& f) {
  int n = f.size();
  vector<ll> g(n);
  g[1] = (f[1] - f[0] + mod) % mod;
  for (int i = 2; i < n; i++) {
    g[i] = 2 * g[i-1] - g[i-2] + i * (f[i] - f[i-1]);
    g[i] %= mod; if (g[i] < 0) g[i] += mod;
  }
  return g[n-1];
}

int main() {
  int n, m; cin >> n >> m;
  vector<ll> x(n), y(m);
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  cout << calc(x) * calc(y) % mod << endl;
}