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