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

typedef long long ll;
 
int main(){
  ll MOD = 1e9 + 7;
  int n, m;
  cin >> n >> m;
  ll x=0, y=0;
  for(int i=1; i<=n; i++){
    ll tmp;
    cin >> tmp;
    x += (i-1)*tmp - (n-i)*tmp;
    x %= MOD;
  }
  for(int i=1; i<=m; i++){
    ll tmp;
    cin >> tmp;
    y += (i-1)*tmp - (m-i)*tmp;
    y %= MOD;
  }
  ll ans = x * y;
  ans %= MOD;
  cout << ans << endl;
  return 0;
  
}
