#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 20;
const long long mod = 1e9 + 7;
long long x[N], y[N];
int main() {
  long long n, m;
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);
    for (int i = 1; i <= m; i++) scanf("%lld", &y[i]);
    long long ans = 0, s1 = 0, s2 = 0;
    for (long long i = 1; i <= n; i++) {
      s1 = s1 + (i - 1) * x[i];
      s1 = s1 - (n - i) * x[i];
      s1 = (s1 + mod) % mod;
    }
    for (long long i = 1; i <= m; i++) {
      s2 = s2 + (i - 1) * y[i];
      s2 = s2 - (m - i) * y[i];
      s2 = (s2 + mod) % mod;
    }
    ans = (s1 * s2) % mod;
    cout << ans << endl;
  }
  return 0;
}
