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