#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), y(m);
  for (long long i = (0); i < (n); ++i) {
    cin >> x[i];
  }
  for (long long i = (0); i < (m); ++i) {
    cin >> y[i];
  }
  long long yokosum = 0, tatesum = 0;
  for (long long i = (1); i < (n); ++i) {
    yokosum += ((x[i] - x[i - 1]) * ((i + 1) * (n - i - 1)) % INF) % INF;
    yokosum %= INF;
  }
  for (long long i = (1); i < (m); ++i) {
    tatesum += ((y[i] - y[i - 1]) * ((i + 1) * (m - i - 1)) % INF) % INF;
  }
  cout << (yokosum * tatesum) % INF << endl;
}
