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