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