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