#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void run();
void init() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
}
signed main() {
  init();
  run();
  return 0;
}
void run() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long i = 0; i < m; i++) cin >> y[i];
  long long sx = 0, sy = 0;
  for (long long i = 0; i < n; i++)
    sx = ((sx + i * x[i] % mod) % mod - (n - i - 1) * x[i] % mod) % mod;
  for (long long i = 0; i < m; i++)
    sy = ((sy + i * y[i] % mod) % mod - (m - i - 1) * y[i] % mod) % mod;
  cout << sx * sy % mod << endl;
}
