#include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9 + 7;

signed main() {
  int n, m;
  cin >> n >> m;
  vector<int> x(n), y(m);
  for (auto&& w : x) cin >> w;
  for (auto&& w : y) cin >> w;
  int sx = 0, sy = 0;
  for (int i = 0; i < n; i++) {
    (sx += (((i) - (n - 1 - i)) * x[i] % mod)) %= mod;
    ;
  }
  for (int i = 0; i < m; i++) {
    (sy += (((i) - (m - 1 - i)) * y[i] % mod)) %= mod;
    ;
  }
  int ans = sx * sy % mod;
  cout << ans << endl;
}