#include <bits/stdc++.h>
using namespace std;

int main() {
  long n,m,a=0,b=0,mod=1000000007;
  cin >> n >> m;
  vector<long> x(n);
  vector<long> y(m);
  for(long i=0;i<n;i++) cin >> x[i];
  for(long i=0;i<m;i++) cin >> y[i];

  for(long i=0;i<n/2;i++) a=(a+((x[n-i-1]+mod-x[i])%mod)*(n-1-i*2))%mod;
  for(long i=0;i<m/2;i++) b=(b+((y[m-i-1]+mod-y[i])%mod)*(m-1-i*2))%mod;
  cout << a*b%mod << endl;
}