#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int main() {
  int n, m;
  int x[100000];
  int y[100000];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int j = 0; j < m; j++) {
    cin >> y[j];
  }
  long long w = 0;
  long long h = 0;
  for (int i = 0; i < n; i++) {
    w = (w + i * x[i] - (n - i - 1) * x[i]) % M;
  }
  for (int j = 0; j < m; j++) {
    h = (h + j * y[j] - (m - j - 1) * y[j]) % M;
  }
  cout << (w * h) % M << endl;
}
