#include <bits/stdc++.h>
using namespace std;
signed main() {
  int64_t M = 10e9 + 7;
  int64_t n, m;
  cin >> n >> m;
  vector<int64_t> x(n), y(m);
  for (int64_t i = (0); i < (n); i++) cin >> x[i];
  for (int64_t i = (0); i < (m); i++) cin >> y[i];
  int64_t W = 0;
  for (int64_t i = (0); i < (n); i++) {
    W += i * x[i] - (n - 1 - i) * x[i];
    W %= M;
  }
  int64_t H = 0;
  for (int64_t i = (0); i < (m); i++) {
    H += i * y[i] - (m - 1 - i) * y[i];
    H %= M;
  }
  cout << H * W % M << endl;
  return 0;
}
