#include <bits/stdc++.h>
using namespace std;
int main() {
  const long long mod = 1000000007;
  long long n, m;
  cin >> n >> m;
  long long X[n], Y[m];
  for (long long i = 0; i < n; i++) cin >> X[i];
  for (long long i = 0; i < m; i++) cin >> Y[i];
  n--;
  m--;
  long long x[n], y[n];
  for (long long i = 1; i <= n; i++) x[i - 1] = X[i] - X[i - 1];
  for (long long i = 1; i <= m; i++) y[i - 1] = Y[i] - Y[i - 1];
  long long sx = 0, sy = 0;
  for (long long i = 0; i < n; i++) {
    sx += (((i + 1) * (n - i)) % mod) * x[i];
    sx %= mod;
  }
  for (long long i = 0; i < m; i++) {
    sy += (((i + 1) * (m - i)) % mod) * y[i];
    sy %= mod;
  }
  cout << (sx * sy) % mod << endl;
  return 0;
}
