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