#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long MOD = 1000000007;
void solve(long long n, long long m, std::vector<long long> x,
           std::vector<long long> y) {
  ll resx = 0;
  for (int k = 0; k <= n; k++) {
    resx += x[k] * (2 * (k + 1) - n - 1) % MOD;
  }
  ll resy = 0;
  for (int k = 0; k <= m; k++) {
    resy += y[k] * (2 * (k + 1) - m - 1) % MOD;
  }
  cout << (resx * resy) % MOD << endl;
}
int main() {
  long long n;
  scanf("%lld", &n);
  long long m;
  scanf("%lld", &m);
  std::vector<long long> x(n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
  }
  std::vector<long long> y(m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &y[i]);
  }
  solve(n, m, std::move(x), std::move(y));
  return 0;
}
