#include <bits/stdc++.h>
using namespace std;
const int INF = 1145141919, MOD = 1e9 + 7;
const long long LINF = 8931145141919364364, LMOD = 998244353;
int main() {
  long long n, m;
  cin >> n >> m;
  long long x[n], y[m];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long xx = 0, yy = 0;
  for (long long i = 0; i < n; i++) {
    xx += x[i] * i % MOD;
    xx -= x[i] * (n - 1 - i) % MOD;
    xx %= MOD;
  }
  for (long long i = 0; i < m; i++) {
    yy += y[i] * i % MOD;
    yy -= y[i] * (m - 1 - i) % MOD;
    yy %= MOD;
  }
  cout << xx * yy % MOD << endl;
  return 0;
}
