#include <bits/stdc++.h>
using namespace std;
vector<long long> X(100010), Y(100010);
int main() {
  int N, M;
  cin >> N >> M;
  long long xal = 0, yal = 0;
  for (int i = 0; i < N; i++) {
    cin >> X[i];
    if (i) {
      xal += (X[i] - X[i - 1]) * (i * (N - i) % 1000000007);
      xal %= 1000000007;
    }
  }
  for (int i = 0; i < M; i++) {
    cin >> Y[i];
    if (i) {
      yal +=
          ((Y[i] - Y[i - 1]) * xal % 1000000007) * (i * (M - i) % 1000000007);
      yal %= 1000000007;
    }
  }
  cout << yal << endl;
}
