#include <iostream>
#include <algorithm>
#include <vector>

int main(){
  int n,m;
  std::cin>>n>>m;

  std::vector<long> xs(n),ys(m);
  for(auto &&x:xs) std::cin>>x;
  for(auto &&y:ys) std::cin>>y;

  std::sort(xs.begin(),xs.end());
  std::sort(ys.begin(),ys.end());

  unsigned long sx = 0,sy=0;
  for(int i=0;i<n;++i){
    sx += i*xs[i]-(n-i-1)*xs[i];
  }
  for(int i=0;i<m;++i){
    sy += i*ys[i]-(m-i-1)*ys[i];
  }
  sx %= 1000000007;
  sy %= 1000000007;
  std::cout<<sx*sy%1000000007<<std::endl;
  return 0;
}