#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m, xx = 0, yy = 0;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (long long i = 0; i < (n); i++) cin >> x.at(i);
  for (long long i = 0; i < (m); i++) cin >> y.at(i);
  for (long long i = 0; i < (n - 1); i++) {
    xx += (x.at(i + 1) - x.at(i)) * (i + 1) * (n - i - 1) % 1000000007;
  }
  for (long long i = 0; i < (m - 1); i++) {
    yy += (y.at(i + 1) - y.at(i)) * (i + 1) * (m - i - 1) % 1000000007;
  }
  cout << xx * yy % 1000000007 << endl;
}
