#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
static const int dx[] = {0, 0, 1, -1};
static const int dy[] = {-1, 1, 0, 0};
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> vx(n);
  vector<long long> vy(m);
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    cin >> vx[i];
  }
  for (int(i) = 0; (i) < (int)(m); (i)++) {
    cin >> vy[i];
  }
  vector<long long> vxd(n - 1);
  for (int(i) = 0; (i) < (int)(n - 1); (i)++) {
    vxd[i + 1] = abs(vx[i] - vx[i + 1]);
  }
  vector<long long> vyd(m - 1);
  for (int(i) = 0; (i) < (int)(m - 1); (i)++) {
    vyd[i + 1] = abs(vy[i] - vy[i + 1]);
  }
  long long yoko = 0;
  int N = n - 1;
  for (int i = 1; i <= N; i++) {
    yoko += vxd[i] * ((i - 1) * i + i * (N - i));
    yoko %= 1000000007;
    ;
  }
  long long tate = 0;
  int M = m - 1;
  for (int i = 1; i <= M; i++) {
    tate += vyd[i] * ((i - 1) * i + i * (M - i));
    tate %= 1000000007;
    ;
  }
  long long ans = tate * yoko % 1000000007;
  ;
  cout << ans << endl;
  return 0;
}
