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