#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<int> x(n), y(m);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> y[i];
  }
  long long x_sum = 0, y_sum = 0;
  for (int k = 0; k < n; ++k) {
    x_sum = (x_sum + (long long)k * x[k] - (n - k - 1) * x[k]) % mod;
  }
  for (int k = 0; k < m; ++k) {
    y_sum = (y_sum + (long long)k * y[k] - (m - k - 1) * y[k]) % mod;
  }
  long long ans = x_sum * y_sum % mod;
  cout << ans << endl;
}
