#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const long long MOD = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> X(n), Y(m);
  for (int i = 0; i < (int)(n); i++) cin >> X[i];
  for (int i = 0; i < (int)(m); i++) cin >> Y[i];
  long long suma = 0, sumb = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    long long tempa =
        ((long long)((X[i + 1] - X[i]) * (i + 1)) % MOD * (n - i - 1)) % MOD;
    suma = (suma + tempa) % MOD;
  }
  for (int i = 0; i < (int)(m - 1); i++) {
    long long tempb =
        ((long long)((Y[i + 1] - Y[i]) * (i + 1)) % MOD * (m - i - 1)) % MOD;
    sumb = (sumb + tempb) % MOD;
  }
  cout << (suma * sumb) % MOD << endl;
  return 0;
}
