#include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;
 
int main(){
  long long n, m, xsum = 0, ysum = 0, x1, x2, y1, y2, i;
  scanf("%lld%lld", &n, &m);
  scanf("%lld", &x1);
  for(i = 1; i < n; i++){
    scanf("%lld", &x2);
    xsum = (xsum + (x2 - x1)*i*(n-i))%MOD;
    x1 = x2;
  }
  scanf("%lld", &y1);
  for(i = 1; i < m; i++){
    scanf("%lld", &y2);
    ysum = (ysum + (y2 - y1)*i*(m-i))%MOD;
    y1 = y2;
  }
  printf("%lld\n", xsum*ysum%MOD);
}