#include <bits/stdc++.h>
using namespace std;
long long solve(vector<long long> &v, int n) {
  long long sum = 0;
  for (int i = 0; i < int(n - 1); ++i) {
    sum += ((v[i + 1] - v[i]) * ((i + 1) * (n - i - 1) % long long(1e9 + 7))) %
           long long(1e9 + 7);
  }
  return sum % long long(1e9 + 7);
}
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (int i = 0; i < int(n); ++i) cin >> x[i];
  for (int i = 0; i < int(m); ++i) cin >> y[i];
  cout << solve(x, n) * solve(y, m) % long long(1e9 + 7) << endl;
  return 0;
}
