#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const int N = 1e5;
ll X[N + 1], Y[N + 1];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> X[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> Y[i];
  }
  ll x = 0, y = 0;
  for (int i = 1; i <= n; i++) {
    x += X[i] * (i - 1) - X[i] * (n - i);
  }
  for (int i = 1; i <= n; i++) {
    y += Y[i] * (i - 1) - Y[i] * (m - i);
  }
  cout << ((x % MOD) * (y % MOD)) % MOD << endl;
  return 0;
}
