#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main(int argc, const char* argv[]) {
  int n, m;
  cin >> n >> m;
  int x[n], y[m];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  int sumx = 0, sumy = 0;
  for (int i = 0; i < n; i++) {
    sumx += (1 - n + 2 * i) * x[i] % mod;
  }
  for (int i = 0; i < m; i++) {
    sumy += (1 - n + 2 * i) * y[i] % mod;
  }
  cout << sumx * sumy % mod << endl;
  return 0;
}
