#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 1000000;
const long long INF = (1LL << 31) - 1;
const double pi = acos(-1);
long long n, m, x[100010], y[100010], sumx = 0, sumy = 0;
int main() {
  cin >> n >> m;
  for (long long i = 0; i < (n); i++) cin >> x[i];
  for (long long i = 0; i < (m); i++) cin >> y[i];
  for (long long i = 0; i < (n); i++)
    sumx += (i * x[i] - (n - 1 - i) * x[i]) % MOD;
  for (long long i = 0; i < (m); i++)
    sumy += (i * y[i] - (n - 1 - i) * y[i]) % MOD;
  cout << (sumx * sumy) % MOD << endl;
}
