#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;
}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> x(n), y(m);
  for (long long int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (long long int i = 0; i < m; i++) {
    cin >> y[i];
  }
  vector<long long int> rx(n - 1, 0), ry(m - 1, 0);
  for (long long int i = 0; i < n - 1; i++) {
    rx[i] = x[i + 1] - x[i];
  }
  for (long long int i = 0; i < m - 1; i++) {
    ry[i] = y[i + 1] - y[i];
  }
  long long int xx = 0, yy = 0;
  for (long long int i = 0; i < n - 1; i++) {
    (xx += rx[i] * (n - 1 + min(i, n - 2 - i)) % (1000000007)) %= (1000000007);
  }
  for (long long int i = 0; i < m - 1; i++) {
    (yy += ry[i] * (m - 1 + min(i, m - 2 - i)) % (1000000007)) %= (1000000007);
  }
  cout << xx * yy % (1000000007) << endl;
}
