#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long> x(n);
  vector<long> y(m);
  int i, j;
  long const mod = 1000000007;
  for (i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (j = 0; j < m; j++) {
    cin >> y[j];
  }
  long xx = 0;
  long yy = 0;
  int tmp = n - 1;
  i = 0;
  j = n - 2;
  while (i <= j) {
    xx += (x[i + 1] - x[i]) * tmp;
    xx += (x[j + 1] - x[j]) * tmp;
    tmp += j - i - 1;
    i++;
    j--;
    xx %= mod;
  }
  tmp = m - 1;
  i = 0;
  j = m - 2;
  while (i <= j) {
    yy += (y[i + 1] - y[i]) * tmp;
    if (i != j) yy += (y[j + 1] - y[j]) * tmp;
    tmp += j - i - 1;
    i++;
    j--;
    yy %= mod;
  }
  cout << xx * yy % mod << endl;
}
