#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  long long xsum = 0;
  for (int i = 1; i < n; i++) {
    xsum = (xsum + (x[i] - x[i - 1]) * (i * (n - i))) % 1000000007;
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  long long ysum = 0;
  for (int i = 1; i < m; i++) {
    ysum = (ysum + (y[i] - y[i - 1]) * (i * (m - i))) % 1000000007;
  }
  cout << xsum * ysum % 1000000007 << endl;
}
