#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
signed main() {
  long long n, m;
  cin >> n >> m;
  long long xsum = 0, ysum = 0;
  for (long long i = 1; i <= n; ++i) {
    long long x;
    cin >> x;
    xsum += (2 * i - n - 1) * x % mod;
  }
  for (long long i = 1; i <= m; ++i) {
    long long y;
    cin >> y;
    ysum += (2 * i - m - 1) * y % mod;
  }
  cout << xsum * ysum % mod << endl;
  return 0;
}
