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