#include <bits/stdc++.h>
#define N 1000000007
using namespace std;
int main() {
  int n,m;
  cin >> n >> m;
  long long x[n],y[m],vertical=0,horizontal=0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  for (int i = 1; i < m; i++) {
    vertical+=((y[i]-y[i-1])*i)%N*(m-i);
    vertical%=N;
  }
  for (int i = 1; i < n; i++) {
    horizontal+=((x[i]-x[i-1])*i)%N*(n-i);
    horizontal%=N;
  }
  cout << (vertical*horizontal)%N;
}