#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;

int main() {
  int n, m; cin >> n >> m;
  ll xsum = 0;
  rep(i, n) {
    ll x; cin >> x;
    xsum = (xsum + (2 * (i + 1) - n - 1) * x % MOD) % MOD;
  }
  ll ysum = 0;
  rep(i, m) {
    ll y; cin >> y;
    ysum = (ysum + (2 * (i + 1) - m - 1) * y % MOD) % MOD;
  }
  cout << xsum * ysum % MOD << endl;
}