#include <iostream>
#include <vector>

#define ll long long
const ll R = 1000000007;

using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  vector<ll> x, y;
  ll x2=0, y2=0;
  for(int i = 0; i < n; ++i){
    ll tmp;
    cin >> tmp;
    x.push_back(tmp);
  }
  for(ll i = 0; i < n-1; ++i){
    ll tmp = ((i+1)*(n-1-i))*(x[i+1]-x[i]);
    x2 += tmp;
    x2 %= R;
  }
  for(int i = 0; i < m; ++i){
    ll tmp;
    cin >> tmp;
    y.push_back(tmp);
  }
  for(ll i = 0; i < m-1; ++i){
    ll tmp = ((i+1)*(m-1-i))*(y[i+1]-y[i]);
    y2 += tmp;
    y2 %= R;
  }
  cout << (x2*y2)%R << endl;
  return 0;
}
