#include <bits/stdc++.h>
using namespace std;
int n, m;
long long x[100000], y[100000], xsum = 0, ysum = 0, ans, mod = 1000000007;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  for (int i = 0; i < n; i++) {
    (xsum += (i * x[i] % mod - (n - (i + 1)) * x[i] % mod) % mod) % mod;
  }
  for (int i = 0; i < m; i++) {
    (ysum += (i * y[i] % mod - (m - (i + 1)) * y[i] % mod) % mod) % mod;
  }
  ans = (xsum * ysum) % mod;
  cout << ans << endl;
}
