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