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