#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;
    xsum %= mod;
    xsum -= (n - (i + 1)) * x[i] % mod;
    xsum %= mod;
  }
  for (int i = 0; i < m; i++) {
    ysum += i * y[i] % mod;
    ysum %= mod;
    ysum -= (m - (i + 1)) * y[i] % mod;
    ysum %= mod;
  }
  ans = (xsum * ysum) % mod;
  cout << ans << endl;
}
