#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m;
  cin >> n >> m;
  vector<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];
  long long sumx = 0, sumy = 0;
  for (long long i = 0; i < n; i++) {
    sumx = (sumx + i * x[i] % (1000000000 + 7) -
            (n - 1 - i) * x[i] % (1000000000 + 7)) %
           (1000000000 + 7);
  }
  for (long long i = 0; i < m; i++) {
    sumy = (sumy + i * y[i] % (1000000000 + 7) -
            (m - 1 - i) * y[i] % (1000000000 + 7)) %
           (1000000000 + 7);
  }
  cout << (sumx * sumy) % (1000000000 + 7) << endl;
  return 0;
}
