// review
#include <iostream>

using namespace std;
typedef long long ll;
const int MAXN = 100010;
const int MOD = 1e9 + 7;

int n, m;
ll x[MAXN], y[MAXN];

void solve() {
  ll xsum = 0;
  ll ysum = 0;
  for (int i=0;i<n;i++) {
    xsum = (xsum + x[i] * (-n + 2 * i + 1)) % MOD;
  }
  for (int i=0;i<m;i++) {
    ysum = (ysum + y[i] * (-m + 2 * i + 1)) % MOD;
  }
  ll ans = xsum * ysum % MOD;
  cout << ans << endl;
}

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