#include <stdio.h>

typedef long long ll;

int main(void)
{
  ll int n,m;
  scanf("%lld %lld",&n,&m);
  ll int i,j,xtotal=0,ytotal=0;
  ll int x[n],y[m];
  for (i=0;i<n;i++) {
    scanf("%lld",&x[i]);
    xtotal += (i-1)*x[i] + (n-i)*x[i]);
  }
  for (i=0;i<m;i++) {
    scanf("%lld",&y[i]);
    ytotal += (i-1)*y[i] + (n-i)*y[i]);
  }

  xtotal = xtotal*ytotal;
  printf("%lld\n",xtotal%(1000000000+7));
}
