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

int main() {
  int n, m;
  cin>>n>>m;
  int xs[n], ys[m];
  for (int i=0; i<n; i++) cin>>xs[i];
  for (int i=0; i<m; i++) cin>>ys[i];
  long long mod = 1e9 + 7;

  long long sum_x = 0;
  for (int i=0; i<n-1; i++) {
    long long d = xs[i+1] - xs[i];
    sum_x += d * (i+1) * (n-i-1);
    sum_x %= mod;
  }
  long long sum_y = 0;
  for (int i=0; i<m-1; i++) {
    long long d = ys[i+1] - ys[i];
    sum_y += d * (i+1) * (m-i-1);
    sum_y %= mod;
  }
  long long ans = sum_x * sum_y;
  ans %= mod;
  cout<<ans<<endl;
}