#include <bits/stdc++.h>
using namespace std;
const long long inf = 100100100100100;
const long long mod = 1000000007;
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  long long n, m;
  cin >> n >> m;
  long long x[n];
  for (long long i = 0; i < n; i++) cin >> x[i];
  long long y[m];
  for (long long i = 0; i < m; i++) cin >> y[i];
  long long xsum = 0;
  long long ysum = 0;
  for (long long i = 0; i < n; i++)
    xsum += ((x[i] * (2 * i - n + 1)) + mod) % mod;
  for (long long i = 0; i < m; i++)
    ysum += ((y[i] * (2 * i - m + 1)) + mod) % mod;
  cout << (xsum % mod * ysum % mod) % mod << endl;
}
