#include <bits/stdc++.h>
using namespace std;
int main() {
  int p = pow(10, 9) + 7;
  cout << p;
  int n, m;
  cin >> n >> m;
  vector<int> x(n);
  vector<int> y(m);
  for (size_t i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (size_t i = 0; i < m; i++) {
    cin >> y[i];
  }
  int SumX(0), SumY(0);
  for (size_t i = 0; i < n; i++) {
    SumX += (i - 1) * x[i] - (n - i) * x[i];
  }
  for (size_t i = 0; i < m; i++) {
    SumY += (i - 1) * y[i] - (n - i) * y[i];
  }
  cout << (SumX * SumY % p);
  return 0;
}
