#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n), dx(n - 1), y(m), dy(m - 1);
  for (long long i = (0); i < (n); ++i) {
    cin >> x[i];
  }
  for (long long i = (0); i < (n - 1); ++i) {
    dx[i] = x[i + 1] - x[i];
  }
  for (long long i = (0); i < (m); ++i) {
    cin >> y[i];
  }
  for (long long i = (0); i < (m - 1); ++i) {
    dy[i] = y[i + 1] - y[i];
  }
  long long yokosum = 0, tatesum = 0;
  for (long long i = (0); i < (n - 1); ++i) {
    yokosum += (dx[i] * (i + 1) * (n - i - 1)) % INF;
    yokosum %= INF;
  }
  for (long long i = (0); i < (m - 1); ++i) {
    tatesum += (dy[i] * (i + 1) * (m - i - 1)) % INF;
  }
  cout << (yokosum * tatesum) % INF << endl;
}
