#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9;
const long long MOD = (long long)1e9 + 7;
const double EPS = (double)1e-10;
struct Accelerate_Cin {
  Accelerate_Cin() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
};
long long n, m;
long long x[100010], y[100010];
long long calc(long long z[], long long l) {
  long long ans = 0;
  for (long long k = 1; k <= l; k++) {
    ans += ((((k - 1)) * (z[k] % MOD)) % MOD -
            ((((l - k)) * (z[k] % MOD) % MOD)) % MOD);
    ans %= MOD;
  }
  return ans;
}
signed main() {
  cin >> n >> m;
  for (long long t = 1; t <= n; t++) cin >> x[t];
  for (long long t = 1; t <= m; t++) cin >> y[t];
  cout << ((calc(x, n) % MOD) * (calc(y, m) % MOD)) % MOD << "\n";
  return 0;
}
