#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long x[100001];
  long long y[100001];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  long long xsum = 0;
  long long ysum = 0;
  for (int i = 0; i <= n - 1; i++) {
    xsum += (x[i] * (2 * i + 1 - n)) % 1000000007;
  }
  for (int i = 0; i <= m - 1; i++) {
    ysum += (y[i] * (2 * i + 1 - m)) % 1000000007;
  }
  long long ans;
  ans = (xsum * ysum) % 1000000007;
  cout << ans;
}
