#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> x(n), y(n), sx(n + 1, 0), sy(n + 1, 0);
  for (int i = 0; i < (int)n; i++) {
    cin >> x[i];
    sx[i + 1] = (sx[i] + x[i]) % mod;
  }
  for (int i = 0; i < (int)m; i++) {
    cin >> y[i];
    sy[i + 1] = (sy[i] + y[i]) % mod;
  }
  long long xf = 0, yf = 0;
  for (int i = 0; i < (int)n; i++) {
    xf += sx[n] - sx[i] - long long(n - i) * x[i] + mod;
    xf %= mod;
  }
  for (int i = 0; i < (int)m; i++) {
    yf += sy[m] - sy[i] - long long(m - i) * y[i] + mod;
    yf %= mod;
  }
  printf("%d\n", xf * yf % mod);
  return 0;
}
