#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1000000007;
int n, m;
int main() {
  cin >> n >> m;
  ll xsum = 0;
  ll mul = n - 1;
  int x;
  cin >> x;
  for (int i = 1; i < n; ++i) {
    int tmp;
    cin >> tmp;
    int w = tmp - x;
    x = tmp;
    xsum += w * mul % MOD;
    mul += n - 1 - 2 * i;
  }
  int y;
  cin >> y;
  mul = m - 1;
  ll ans = 0;
  for (int i = 1; i < m; ++i) {
    int tmp;
    cin >> tmp;
    int h = tmp - y;
    y = tmp;
    ll a = h * mul % MOD;
    a = a * xsum % MOD;
    ans = (ans + a) % MOD;
    mul += m - 1 - 2 * i;
  }
  cout << ans << endl;
}
