#include <iostream>
using namespace std;

typedef long long ll;
const int MOD = 1e+9 + 7;
const int MAX = 1e+5;
int n, m;
ll x[MAX+1], y[MAX+1];

int main() {
  // 入力
  cin >> n >> m;
  for (int i=1; i<=n; i++) cin >> x[i];
  for (int i=1; i<=m; i++) cin >> y[i];
  ll sum_x, sum_y;
  sum_x = sum_y = 0;
  for (int k=1; k<=n; k++) {
    sum_x += ((k - 1)*x[k] - (n - k)*x[k]) % MOD;
    sum_x %= MOD;
  }
  for (int k=1; k<=m; k++) {
    sum_y += ((k - 1)*y[k] - (m - k)*y[k]) % MOD;
    sum_y %= MOD;
  }
  cout << (sum_x * sum_y) % MOD << endl;
  return 0;
}
