#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;

int main(int argc, const char * argv[]) {
  ll n, m;
  cin >> n >> m;

  ll x[n], y[m];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }

  ll sumx = 0, sumy = 0;
  for (int i = 0; i < n; i++) {
    sumx = (sumx + (1 - n + 2 * i) * x[i]) % mod;
  }
  for (int i = 0; i < m; i++) {
    sumy = (sumy + (1 - m + 2 * i) * y[i]) % mod;
  }
  cout << sumx * sumy % mod << endl;
  return 0;
}
