#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define ll long long
#define P pair<int, int>

using namespace std;
int mod = 1000000007;

ll n, m;
int main() {
  cin >> n >> m;

  vector<ll> x(n);
  vector<ll> y(m);
  rep(i, n) {
    cin >> x.at(i);
  }
  rep(i, m) {
    cin >> y.at(i);
  }

  n--;
  m--;
  ll sumx = 0;
  ll sumy = 0;
  for(ll i=0; i<n; i++) {
    ll mul = ((n-i)*(i+1))%mod;
    sumx += (x.at(i+1)-x.at(i)*mul%mod;
    sumx %= mod;
  }
  for(ll i=0; i<m; i++) {
    ll mul = ((m-i)*(i+1))%mod;
    sumy += (y.at(i+1)-y.at(i))*mul%mod;
    sumy %= mod;
  }
  cout << (sumx*sumy)%mod << endl;
}
