#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using pll = pair<long long, long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> x(n), y(m);
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  for (int i = 0; i < (int)(m); i++) cin >> y[i];
  ll A = 0, B = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    A += (i + 1) * (n - (i + 1)) * (x[i + 1] - x[i]);
    A %= MOD;
  }
  for (int i = 0; i < (int)(m - 1); i++) {
    B += (i + 1) * (m - (i + 1)) * (y[i + 1] - y[i]);
    B %= MOD;
  }
  cout << (A * B) % MOD << endl;
  return 0;
}
