#include <iostream>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
int main(void) {
  int n, m;
  ll x, y;
  cin >> n >> m;
  ll sumx = 0, sumy = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    sumx = (sumx + ((2 * i - n + 1) * x + MOD) % MOD) % MOD;
  }
  for (int i = 0; i < m; i++) {
    cin >> y;
    sumy = (sumy + ((2 * i - m + 1) * y + MOD) % MOD) % MOD;
  }
  cout << sumx * sumy % MOD << endl;
  return 0;
}