#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  unsigned long long int mod, mul;
  mod = (long long int)(pow(10, 7) + 7);
  mul = (n - 1) * (m - 1);
  vector<long long int> x(n);
  vector<long long int> y(m);
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  for (int i = 0; i < (int)(m); i++) cin >> y[i];
  vector<long long int> dx;
  vector<long long int> dy;
  for (int i = 0; i < (int)(n - 1); i++) {
    dx.push_back(x[i + 1] - x[i]);
  }
  for (int i = 0; i < (int)(m - 1); i++) dy.push_back(y[i + 1] - y[i]);
  unsigned long long int sum = 0, tmp, xdistans, ydistans;
  vector<vector<unsigned long long int>> area(
      n - 1, vector<unsigned long long int>(m - 1, 0));
  vector<vector<unsigned long long int>> num(
      n - 1, vector<unsigned long long int>(m - 1, 0));
  for (int i = 0; i < (int)(dx.size()); i++) {
    for (int j = 0; j < (int)(dy.size()); j++) {
      area[i][j] = dx[i] * dy[j];
    }
  }
  if ((n - 1) % 2 == 0) {
    xdistans = ((n - 1) / 2) - 1;
  } else {
    xdistans = (n - 1) / 2;
  }
  if ((m - 1) % 2 == 0) {
    ydistans = ((m - 1) / 2) - 1;
  } else {
    ydistans = (m - 1) / 2;
  }
  for (int i = 0; i < (int)((int)num.size() / 2); i++) {
    for (int j = 0; j < (int)((int)num[i].size() / 2); j++) {
      num[i][j] = mul - (xdistans - i) - (ydistans - j);
      num[i][num[i].size() - 1 - j] = mul - (xdistans - i) - (ydistans - j);
      num[num.size() - 1 - i][j] = mul - (xdistans - i) - (ydistans - j);
      num[num.size() - 1 - i][num[i].size() - 1 - j] =
          mul - (xdistans - i) - (ydistans - j);
    }
  }
  if ((n - 1) % 2 == 1) {
    for (int j = 0; j < (int)(num[n / 2].size() / 2); j++) {
      num[(n - 1) / 2][j] = mul - (ydistans - j);
      num[(n - 1) / 2][num[n / 2].size() - 1 - j] = mul - (ydistans - j);
    }
  }
  if ((m - 1) % 2 == 1) {
    for (int i = 0; i < (int)(num.size() / 2); i++) {
      num[i][(m - 1) / 2] = mul - (xdistans - i);
      num[num.size() - 1 - i][(m - 1) / 2] = mul - (xdistans - i);
    }
  }
  if ((m - 1 % 2 == 1) && (n - 1 % 2 == 1)) num[(n - 1) / 2][(m - 1) / 2] = mul;
  for (int i = 0; i < (int)(num.size()); i++) {
    for (int j = 0; j < (int)(num[i].size()); j++) {
      sum += num[i][j] * area[i][j];
    }
  }
  cout << sum % mod << endl;
  return 0;
}
