#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1000000007;

int main()
{
  int64_t n, m, sx = 0, sy = 0;
  cin >> n >> m;
  vector<int64_t> x(n), y(m);
  for (int i = 0; i < n; i++)
  {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++)
  {
    cin >> y[i];
  }
  for (int i = 0; i < n; i++)
  {
    sx = (sx + i * x[i] - (n - 1 - i) * x[i]) % MOD;
  }
  for (int i = 0; i < m; i++)
  {
    sy = (sy + i * y[i] - (m - 1 - i) * y[i]) % MOD;
  }
  cout << (sx * sy) % MOD << endl;
}
