#include <iostream>
#include <algorithm>
#define int long long
using namespace std;
const int mod = 1e9+7;

signed main() {
  int n, m; cin >> n >> m;
  int xsum = 0, ysum = 0;
  for(int i = 1; i <= n; ++i) {
    int x; cin >> x;
    xsum = (xsum + (2 * i - n - 1) * x % mod) % mod;
  }
  for(int i = 1; i <= m; ++i) {
    int y; cin >> y;
    ysum = (ysum + (2 * i - m - 1) * y % mod) % mod;
  }
  cout << xsum * ysum % mod << endl;
  return 0;
}

