#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MAX = 1e5 + 5;
const long long MOD = 1e9 + 7;
long long x[MAX], y[MAX];
long long C, c;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, b;
  cin >> a >> b;
  for (long long i = 1; i <= a; i++) cin >> x[i];
  for (long long i = 1; i <= b; i++) {
    cin >> y[i];
    c += y[i];
    c %= MOD;
    C += y[i] * i;
    C %= MOD;
  }
  c %= MOD;
  C %= MOD;
  long long ans = 0;
  for (long long i = 1; i <= a; i++) {
    long long r = 0;
    r += (4 * i * C) % MOD;
    r %= MOD;
    r += MOD - (2 * i * c) % MOD;
    r %= MOD;
    r += MOD - (2 * C) % MOD;
    r %= MOD;
    r += MOD - (2 * i * b % MOD * c) % MOD;
    r %= MOD;
    r += MOD - (2 * a * C) % MOD;
    r %= MOD;
    r += (a + 1) * (b + 1) % MOD * c % MOD;
    r %= MOD;
    ans += r * x[i] % MOD;
    ans %= MOD;
  }
  cout << ans << '\n';
}
