#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n, m;
  cin >> n >> m;
  long long D = 1e9 + 7;
  vector<long long> x(n), y(m);
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  for (int i = 0; i < n - 1; i++) x[i] = x[i + 1] - x[i];
  for (int i = 0; i < m - 1; i++) y[i] = y[i + 1] - y[i];
  long long sx = 0, sy = 0;
  n--;
  m--;
  for (int j = 0; j < n; j++) {
    int i = min(j, n - 1 - j);
    sx = (sx + ((i + 1) * n - i * (i + 1)) * x[j]) % D;
  }
  for (int j = 0; j < m; j++) {
    int i = min(j, m - 1 - j);
    sy = (sy + ((i + 1) * m - i * (i + 1)) * y[j]) % D;
  }
  cout << sx * sy % D << endl;
}
