#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  ll sumx = 0;
  ll sumy = 0;
  int p = n - 1;
  int q = m - 1;
  for (int i = 0; i < n; ++i) {
    ll x;
    cin >> x;
    sumx += ((2 * i - p) * x) % 1000000007;
  }
  for (int i = 0; i < m; ++i) {
    ll y;
    cin >> y;
    sumy += ((2 * i - q) * y) % 1000000007;
  }
  cout << (sumx * sumy) % 1000000007 << endl;
  return 0;
}
