#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 26;
const int mod = 1e9 + 7;
int n, m;
int ta, tb;
int main() {
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    ta -= a[i] * (n - i - 1);
    ta += a[i] * i;
  }
  for (int i = 0; i < m; i++) {
    tb -= b[i] * (m - i - 1);
    tb += b[i] * i;
  }
  long long q = (ta % mod) * (tb % mod) % mod;
  cout << q << endl;
  return 0;
}
