#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll MOD = 1e9 + 7;

int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> x(n), y(m);
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];

  ll xx = 0, yy = 0, cx = x[0], cy = y[0];
  for (int i = 1; i < n; i++) {
    xx = (xx + i * x[i] - cx) % MOD;
    cx = (cx + x[i]) % MOD;
  }
  for (int i = 1; i < m; i++) {
    yy = (yy + i * y[i] - cy) % MOD;
    cy = (cy + y[i]) % MOD;
  }
  cout << xx * yy % MOD << endl;
}