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